Skip to content

Commit

Permalink
Merge pull request ceph#19199 from tchaikov/wip-22136
Browse files Browse the repository at this point in the history
 qa/ceph-disk: enlarge the simulated SCSI disk

Reviewed-by: Alfredo Deza <[email protected]>
  • Loading branch information
tchaikov authored Nov 28, 2017
2 parents 2241b9d + b3c159e commit 6a9e622
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
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

0 comments on commit 6a9e622

Please sign in to comment.