X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=system%2FTestPlc.py;h=526f9a6373c239ab1a82d154fdd9b44636e7d4ac;hb=2ce1faf69bf49df3c406303c30d1d2bc04fab44d;hp=726720157ddc61555841deda6125bb21bc713764;hpb=b4f9e7599898f23099c8519a7d31434958fe74e2;p=tests.git diff --git a/system/TestPlc.py b/system/TestPlc.py index 7267201..526f9a6 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -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_import', 'sfa_start', 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, @@ -105,20 +105,18 @@ class TestPlc: 'force_gather_logs', SEP, ] other_steps = [ - 'export', - 'check_hooks', - 'free_all', - 'show_boxes', 'local_list','local_rel','local_rel_plc','local_rel_qemu',SEP, - 'plc_stop', 'vs_start', 'vs_stop', SEP, + 'export', 'show_boxes', SEP, + 'check_hooks', 'plc_stop', 'vs_start', 'vs_stop', SEP, 'delete_initscripts', 'delete_nodegroups','delete_all_sites', SEP, 'delete_sites', 'delete_nodes', 'delete_slices', 'keys_clean', SEP, 'delete_leases', 'list_leases', SEP, '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, + 'standby_1_through_20',SEP, ] @staticmethod @@ -200,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', @@ -466,36 +472,36 @@ class TestPlc: now=int(time.time()) return utils.system(self.test_ssh.actual_command("echo %d > /vservers/%s.timestamp"%(now,self.vservername)))==0 - def local_pre (self): - "run site-dependant pre-test script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_pre(self) - - def local_post (self): - "run site-dependant post-test script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_post(self) - - def local_list (self): - "run site-dependant list script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_list(self) - - def local_rel (self): - "run site-dependant release script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_release(self) - - def local_rel_plc (self): - "run site-dependant release script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_release_plc(self) - - def local_rel_qemu (self): - "run site-dependant release script as defined in LocalTestResources" - from LocalTestResources import local_resources - return local_resources.step_release_qemu(self) - +# def local_pre (self): +# "run site-dependant pre-test script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_pre(self) +# +# def local_post (self): +# "run site-dependant post-test script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_post(self) +# +# def local_list (self): +# "run site-dependant list script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_list(self) +# +# def local_rel (self): +# "run site-dependant release script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_release(self) +# +# def local_rel_plc (self): +# "run site-dependant release script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_release_plc(self) +# +# def local_rel_qemu (self): +# "run site-dependant release script as defined in LocalTestResources" +# from LocalTestResources import local_resources +# return local_resources.step_release_qemu(self) +# def vs_delete(self): "vserver delete the test myplc" self.run_in_host("vserver --silent %s delete"%self.vservername) @@ -567,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): @@ -582,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', @@ -1121,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" @@ -1216,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.. @@ -1471,6 +1490,9 @@ class TestPlc: utils.header('Database restored from ' + dump) + def standby_1_through_20(self): + """convenience function to wait for a specified number of minutes""" + pass @standby_generic def standby_1(): pass @standby_generic