from PlcapiUrlScanner import PlcapiUrlScanner
from Completer import Completer, CompleterTask
+has_sfa_cache_filename="sfa-cache"
+
# step methods must take (self) and return a boolean (options is a member of the class)
def standby(minutes,dry_run):
'sfa_install_all', 'sfa_configure', 'cross_sfa_configure', 'sfa_start', 'sfa_import', SEPSFA,
'sfi_configure@1', 'sfa_add_site@1','sfa_add_pi@1', SEPSFA,
'sfa_add_user@1', 'sfa_update_user@1', 'sfa_add_slice@1', 'sfa_renew_slice@1', SEPSFA,
+ 'sfa_remove_user_from_slice@1','sfi_show_slice_researchers@1',
+ 'sfa_insert_user_in_slice@1','sfi_show_slice_researchers@1', SEPSFA,
'sfa_discover@1', 'sfa_create_slice@1', 'sfa_check_slice_plc@1', 'sfa_update_slice@1', SEPSFA,
- 'sfi_list@1', 'sfi_show@1', 'sfa_utest@1', SEPSFA,
+ 'sfi_list@1', 'sfi_show_site@1', 'sfa_utest@1', SEPSFA,
# we used to run plcsh_stress_test, and then ssh_node_debug and ssh_node_boot
# but as the stress test might take a while, we sometimes missed the debug mode..
+ 'probe_kvm_iptables',
'ping_node', 'ssh_node_debug', 'plcsh_stress_test@1', SEP,
'ssh_node_boot', 'node_bmlogs', 'ssh_slice', 'ssh_slice_basics', 'check_initscripts_ignore', SEP,
'ssh_slice_sfa@1', 'sfa_delete_slice@1', 'sfa_delete_user@1', SEPSFA,
# this was originally for centos5 but is still valid
# for up to f12 as recent SFAs with sqlalchemy won't build before f14
@staticmethod
- def check_whether_build_has_sfa (rpms_url):
- utils.header ("Checking if build provides SFA package...")
+ def _has_sfa_cached (rpms_url):
+ if os.path.isfile(has_sfa_cache_filename):
+ cached=file(has_sfa_cache_filename).read()=="yes"
+ utils.header("build provides SFA (cached):%s"%cached)
+ return cached
# warning, we're now building 'sface' so let's be a bit more picky
- retcod=os.system ("curl --silent %s/ | grep -q sfa-"%rpms_url)
# full builds are expected to return with 0 here
- if retcod==0:
+ utils.header ("Checking if build provides SFA package...")
+ retcod=os.system ("curl --silent %s/ | grep -q sfa-"%rpms_url)==0
+ encoded='yes' if retcod else 'no'
+ file(has_sfa_cache_filename,'w').write(encoded)
+ return retcod
+
+ @staticmethod
+ def check_whether_build_has_sfa (rpms_url):
+ has_sfa=TestPlc._has_sfa_cached(rpms_url)
+ if has_sfa:
utils.header("build does provide SFA")
else:
# move all steps containing 'sfa' from default_steps to other_steps
for key in val:
self.display_key_spec (key)
elif passno == 1:
- if key not in ['sites','initscripts','slices','keys', 'sfa']:
+ if key not in ['sites','initscripts','slices','keys']:
print '+ ',key,':',val
def display_site_spec (self,site):
def nodes_booted(self):
return self.nodes_check_boot_state('boot',timeout_minutes=30,silent_minutes=28)
+ def probe_kvm_iptables (self):
+ (_,kvmbox) = self.all_node_infos()[0]
+ TestSsh(kvmbox).run("iptables-save")
+ return True
+
# probing nodes
def check_nodes_ping(self,timeout_seconds=120,period_seconds=10):
class CompleterTaskPingNode (CompleterTask):
@auth_sfa_mapper
def sfa_update_slice(self): pass
@auth_sfa_mapper
+ def sfa_remove_user_from_slice(self): pass
+ @auth_sfa_mapper
+ def sfa_insert_user_in_slice(self): pass
+ @auth_sfa_mapper
def sfi_list(self): pass
@auth_sfa_mapper
- def sfi_show(self): pass
+ def sfi_show_site(self): pass
+ @auth_sfa_mapper
+ def sfi_show_slice(self): pass
+ @auth_sfa_mapper
+ def sfi_show_slice_researchers(self): pass
@auth_sfa_mapper
def ssh_slice_sfa(self): pass
@auth_sfa_mapper