Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qa/ceph-disk: enlarge the simulated SCSI disk #19199

Merged
merged 5 commits into from
Nov 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions qa/workunits/ceph-disk/ceph-disk-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def sh(command):
proc = subprocess.Popen(
args=command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True,
bufsize=1)
output, _ = proc.communicate()
Expand Down Expand Up @@ -113,7 +112,7 @@ def ensure_sd(self):
LOG.debug(self.unused_disks('sd.'))
if self.unused_disks('sd.'):
return
modprobe = "modprobe scsi_debug vpd_use_hostno=0 add_host=1 dev_size_mb=200 ; udevadm settle"
modprobe = "modprobe scsi_debug vpd_use_hostno=0 add_host=1 dev_size_mb=300 ; udevadm settle"
try:
self.sh(modprobe)
except:
Expand Down
12 changes: 7 additions & 5 deletions src/ceph-disk/ceph_disk/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ def write_one_line(parent, name, text):
with open(tmp, 'wb') as tmp_file:
tmp_file.write(text.encode('utf-8') + b'\n')
os.fsync(tmp_file.fileno())
path_set_context(tmp)
os.rename(tmp, path)
path_set_context(path)


def init_get():
Expand Down Expand Up @@ -1292,6 +1292,8 @@ def get_dmcrypt_key(
path = os.path.join(STATEDIR, 'osd-lockbox', _uuid)
if os.path.exists(path):
mode = get_oneliner(path, 'key-management-mode')
if mode is None:
raise Error('unable to read key-management-mode from %s' % path)
osd_uuid = get_oneliner(path, 'osd-uuid')
ceph_fsid = read_one_line(path, 'ceph_fsid')
if ceph_fsid is None:
Expand Down Expand Up @@ -2733,8 +2735,8 @@ def set_or_create_partition(self):
ptype = self.partition.get_ptype()
ready = Ptype.get_ready_by_name('lockbox')
if ptype not in ready:
LOG.warning('incorrect partition UUID: %s, expected %s'
% (ptype, str(ready)))
LOG.warning('incorrect partition UUID: %s, expected %s',
ptype, str(ready))
else:
LOG.debug('Creating osd partition on %s',
self.args.lockbox)
Expand Down Expand Up @@ -2778,12 +2780,12 @@ def symlink_spaces(self, path):
def populate(self):
maybe_mkdir(os.path.join(STATEDIR, 'osd-lockbox'))
args = ['mkfs', '-t', 'ext4', self.partition.get_dev()]
LOG.debug('Creating lockbox fs on %s: ' + str(" ".join(args)))
LOG.debug('Creating lockbox fs: %s', " ".join(args))
command_check_call(args)
path = self.get_mount_point()
maybe_mkdir(path)
args = ['mount', '-t', 'ext4', self.partition.get_dev(), path]
LOG.debug('Mounting lockbox ' + str(" ".join(args)))
LOG.debug('Mounting lockbox: %s', " ".join(args))
command_check_call(args)
write_one_line(path, 'osd-uuid', self.args.osd_uuid)
if self.args.cluster_uuid is None:
Expand Down