new steps to change a node's fcdistro in a bonding environment
Thierry Parmentelat [Mon, 27 Apr 2015 12:42:03 +0000 (14:42 +0200)]
system/TestApiserver.py
system/TestNode.py
system/TestPlc.py

index 00a73ac..010b86c 100644 (file)
@@ -9,6 +9,7 @@ import xmlrpc.client
 server_methods = [ ('GetNodes' ,  []),
                    ('AddNode' , True),
                    ('SetNodePlainBootstrapfs', True),
+                   ('SetNodeFcdistro', True),
                    ('DeleteNode' , True),
                    ('UpdateNode' , True),
                    ('AddInterface' , True),
index 3af821e..54de26c 100644 (file)
@@ -217,9 +217,33 @@ class TestNode:
             print("Dry_run: skipped getting current node state")
             return True
         state = self.test_plc.apiserver.GetNodes(self.test_plc.auth_root(), self.name(), ['boot_state'])[0]['boot_state']
-        print(self.name(),':',state)
+        print("boot_state for {} : {}".format(self.name(), state))
         return True
     
+    def nodefcdistro_f14(self):
+        return self.nodefcdistro_set('f14')
+    def nodefcdistro_f18(self):
+        return self.nodefcdistro_set('f18')
+    def nodefcdistro_f20(self):
+        return self.nodefcdistro_set('f20')
+    def nodefcdistro_f21(self):
+        return self.nodefcdistro_set('f21')
+    def nodefcdistro_set(self, distro):
+        "set the fcdistro tag to distro, passed in arg"
+        self.test_plc.apiserver.SetNodeFcdistro(self.test_plc.auth_root(),
+                                               self.name(), distro)
+        return True
+
+    def nodefcdistro_show(self):
+        "display the fcdistro tag - or flavour actually - of node"
+        if self.dry_run():
+            print("Dry_run: would fetch node flavour")
+            return True
+        flavour = self.test_plc.apiserver.GetNodeFlavour(self.test_plc.auth_root(),
+                                                         self.name())
+        print("Flavour for {} : {}".format(self.name(), flavour))
+        return True
+
     def qemu_local_config(self):
         "all nodes: compute qemu config qemu.conf and store it locally"
         if not self.is_qemu():
index 8d2138c..3005b20 100644 (file)
@@ -196,6 +196,7 @@ class TestPlc:
         'delete_leases', 'list_leases', SEP,
         'populate', SEP,
         'nodestate_show','nodestate_safeboot','nodestate_boot', 'nodestate_upgrade', SEP,
+        'nodefcdistro_show','nodefcdistro_f14','nodefcdistro_f18', 'nodefcdistro_f20', 'nodefcdistro_f21', SEP,
         'qemu_list_all', 'qemu_list_mine', 'qemu_kill_all', SEP,
         'sfa_install_core', 'sfa_install_sfatables', 'sfa_install_plc', 'sfa_install_client', SEPSFA,
         'sfa_plcclean', 'sfa_dbclean', 'sfa_stop','sfa_uninstall', 'sfi_clean', SEPSFA,
@@ -1190,6 +1191,8 @@ class TestPlc:
     @node_mapper
     def qemu_local_config(self): pass
     @node_mapper
+    def qemu_export(self): pass
+    @node_mapper
     def nodestate_reinstall(self): pass
     @node_mapper
     def nodestate_upgrade(self): pass
@@ -1200,7 +1203,15 @@ class TestPlc:
     @node_mapper
     def nodestate_show(self): pass
     @node_mapper
-    def qemu_export(self): pass
+    def nodefcdistro_f14(self): pass
+    @node_mapper
+    def nodefcdistro_f18(self): pass
+    @node_mapper
+    def nodefcdistro_f20(self): pass
+    @node_mapper
+    def nodefcdistro_f21(self): pass
+    @node_mapper
+    def nodefcdistro_show(self): pass
         
     ### check hooks : invoke scripts from hooks/{node,slice}
     def check_hooks_node(self):