From: John Mulligan Date: Wed, 19 Nov 2025 21:29:25 +0000 (-0500) Subject: qa/workunits/smb: extend smb test config X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=802b6f0e9796edb1fbe8afc6d303afdf069a5597;p=ceph.git qa/workunits/smb: extend smb test config Extend the structures provided by the test config so that we can do ssh access to the 'admin node'. Split server info from client info. Signed-off-by: John Mulligan --- diff --git a/qa/workunits/smb/tests/smbutil.py b/qa/workunits/smb/tests/smbutil.py index 11e64fe92889..97c1d6808f78 100644 --- a/qa/workunits/smb/tests/smbutil.py +++ b/qa/workunits/smb/tests/smbutil.py @@ -6,8 +6,8 @@ import smbclient from smbprotocol.header import NtStatus -class SMBTestServer: - """Server configuration wrapper.""" +class SMBTestHost: + """Host configuration wrapper.""" def __init__(self, data): self._server_data = data @@ -20,10 +20,18 @@ class SMBTestServer: def name(self): return self._server_data.get('name', '') + +class SMBTestServer(SMBTestHost): + """Server configuration wrapper.""" + @property def port(self): return 445 + @property + def ssh_user(self): + return self._server_data.get('user', '') + class SMBTestConf: """Global test configuration wrapper.""" @@ -54,6 +62,30 @@ class SMBTestConf: nodes = self._data.get('smb_nodes', []) return SMBTestServer(nodes[0]) + @property + def admin_node(self): + return SMBTestServer(self._data.get('admin_node', {})) + + @property + def ssh_user(self): + uname = self.admin_node.ssh_user + assert uname, 'no ssh_user found' + return uname + + @property + def ssh_admin_host(self): + return self.admin_node.ip_address + + def clients(self): + clients = self._data.get('client_nodes') or [] + return [SMBTestHost(node_info) for node_info in clients] + + @property + def default_client(self): + # ideally we check that this is *our* ip or name, but we'll just wing + # it for now until we really need to check + return self.clients()[0] + @contextlib.contextmanager def connection(conf, share):