]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/smb: extend smb test config
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 19 Nov 2025 21:29:25 +0000 (16:29 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 29 Jan 2026 17:07:04 +0000 (12:07 -0500)
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 <jmulligan@redhat.com>
qa/workunits/smb/tests/smbutil.py

index 11e64fe92889f355f313511783b0b59ab827ec66..97c1d6808f780cfbd9e5c775628ee2ea359f037a 100644 (file)
@@ -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):