sfa users have different names
[tests.git] / system / TestPlc.py
index 06c595f..526f9a6 100644 (file)
@@ -92,7 +92,7 @@ class TestPlc:
         'initscripts', 'sites', 'nodes', 'slices', 'nodegroups', 'leases', SEP,
         'nodestate_reinstall', 'qemu_local_init','bootcd', 'qemu_local_config', SEP,
         'qemu_export', 'qemu_kill_mine', 'qemu_start', 'timestamp_qemu', SEP,
-       'sfa_install', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', SEPSFA,
+        'sfa_install_all', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', SEPSFA,
         'sfi_configure@1', 'sfa_add_user@1', 'sfa_add_slice@1', 'sfa_discover@1', SEPSFA,
         'sfa_create_slice@1', 'sfa_check_slice_plc@1', SEPSFA, 
         'sfa_update_user@1', 'sfa_update_slice@1', 'sfa_view@1', 'sfa_utest@1',SEPSFA,
@@ -113,7 +113,8 @@ class TestPlc:
         'populate' , SEP,
         'nodestate_show','nodestate_safeboot','nodestate_boot', SEP,
         'qemu_list_all', 'qemu_list_mine', 'qemu_kill_all', SEP,
-        'sfa_plcclean', 'sfa_dbclean', 'sfa_stop','sfa_uninstall', 'sfi_clean', 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,
         'plc_db_dump' , 'plc_db_restore', SEP,
         'standby_1_through_20',SEP,
         ]
@@ -197,6 +198,14 @@ class TestPlc:
     def run_in_guest_piped (self,local,remote):
         return utils.system(local+" | "+self.test_ssh.actual_command(self.host_to_guest(remote),keep_stdin=True))
 
+    # does a yum install in the vs, ignore yum retcod, check with rpm
+    def yum_install (self, rpms):
+        if isinstance (rpms, list): 
+            rpms=" ".join(rpms)
+        self.run_in_guest("yum -y install %s"%rpms)
+        self.run_in_guest("yum-complete-transaction")
+        return  self.run_in_guest("rpm -q %s"%rpms)==0
+
     def auth_root (self):
        return {'Username':self.plc_spec['PLC_ROOT_USER'],
                'AuthMethod':'password',
@@ -564,8 +573,7 @@ class TestPlc:
         pkgs_list.append ("noderepo-%s"%nodefamily)
         pkgs_list.append ("bootstrapfs-%s-plain"%nodefamily)
         pkgs_string=" ".join(pkgs_list)
-        self.run_in_guest("yum -y install %s"%pkgs_string)
-        return self.run_in_guest("rpm -q %s"%pkgs_string)==0
+        return self.yum_install (pkgs_list)
 
     ### 
     def plc_configure(self):
@@ -579,7 +587,7 @@ class TestPlc:
                      'PLC_MAIL_ENABLED',
                      'PLC_MAIL_SUPPORT_ADDRESS',
                      'PLC_DB_HOST',
-                     'PLC_DB_PASSWORD',
+#                     'PLC_DB_PASSWORD',
                     # Above line was added for integrating SFA Testing
                      'PLC_API_HOST',
                      'PLC_WWW_HOST',
@@ -1118,13 +1126,25 @@ class TestPlc:
     # in particular runs with --preserve (dont cleanup) and without --check
     # also it gets run twice, once with the --foreign option for creating fake foreign entries
 
-    ### sfa_install_rpm
-    def sfa_install(self):
-        "yum install sfa, sfa-plc and sfa-client"
-        # ignore yum retcod
-        self.run_in_guest("yum -y install sfa sfa-client sfa-plc sfa-sfatables")
-        return  self.run_in_guest("rpm -q sfa sfa-client sfa-plc sfa-sfatables")==0
+    def sfa_install_all (self):
+        "yum install sfa sfa-plc sfa-sfatables sfa-client"
+        return self.yum_install ("sfa sfa-plc sfa-sfatables sfa-client")
+
+    def sfa_install_core(self):
+        "yum install sfa"
+        return self.yum_install ("sfa")
+        
+    def sfa_install_plc(self):
+        "yum install sfa-plc"
+        return self.yum_install("sfa-plc")
         
+    def sfa_install_client(self):
+        "yum install sfa-client"
+        return self.yum_install("sfa-client")
+        
+    def sfa_install_sfatables(self):
+        "yum install sfa-sfatables"
+        return self.yum_install ("sfa-sfatables")
 
     def sfa_dbclean(self):
         "thoroughly wipes off the SFA database"
@@ -1213,12 +1233,14 @@ class TestPlc:
                     'SFA_REGISTRY_HOST',
                     'SFA_AGGREGATE_HOST',
                      'SFA_SM_HOST',
+                    'SFA_PLC_URL',
                      'SFA_PLC_USER',
                      'SFA_PLC_PASSWORD',
-                     'SFA_PLC_DB_HOST',
-                     'SFA_PLC_DB_USER',
-                     'SFA_PLC_DB_PASSWORD',
-                    'SFA_PLC_URL',
+#                     'SFA_DB_HOST',
+#                     'SFA_DB_USER',
+#                     'SFA_DB_PASSWORD',
+                     # should be tmp
+#                     'SFA_DB_NAME',
                      ]:
             fileconf.write ('e %s\n%s\n'%(var,self.plc_spec['sfa'][var]))
         # the way plc_config handles booleans just sucks..