qa/ceph_manager: preserve newline char at EOF in keyring

Lack of newline character at the end of keyring file makes CephFS mount
command end with error.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
This commit is contained in:
Rishabh Dave 2023-03-31 01:05:32 +05:30
parent ef6b9ae3c7
commit 1944977522
2 changed files with 2 additions and 3 deletions

View File

@ -1607,8 +1607,7 @@ class CephManager:
client_id = client_id.replace('client.', '')
keyring = self.run_cluster_cmd(args=f'auth get client.{client_id}',
stdout=StringIO()).\
stdout.getvalue().strip()
stdout=StringIO()).stdout.getvalue()
assert isinstance(keyring, str) and keyring != ''
return keyring

View File

@ -287,7 +287,7 @@ class XFSTestsDev(CephFSTestCase):
ceph_fuse_bin_path = join(os_getcwd(), 'bin', 'ceph-fuse')
keyring_path = self.mount_a.client_remote.mktemp(
data=self.fs.mon_manager.get_keyring('client.admin')+'\n')
data=self.fs.mon_manager.get_keyring('client.admin'))
lastline = (f'export CEPHFS_MOUNT_OPTIONS="-m {mon_sock} -k '
f'{keyring_path} --client_mountpoint /{self.test_dirname}')