('AddNodeGroup' , True),
('AddNodeToNodeGroup' , True),
('AddInitScript' , True),
+ ('DeleteInitScript', True),
+ ('GetInitScripts', True),
('AddSite' , True),
('AddSiteAddress' , True),
('DeleteSite' , True),
or %s
config defaults to the last value used, as stored in arg-config,
or %r
-ips defaults to the last value used, as stored in arg-ips,
+node-ips and plc-ips defaults to the last value used, as stored in arg-node-ips and arg-plc-ips,
default is to use IP scanning
steps refer to a method in TestPlc or to a step_* module
===
help="Run all default steps")
parser.add_option("-l","--list",action="store_true",dest="list_steps", default=False,
help="List known steps")
- parser.add_option("-i","--ip",action="callback", callback=TestMain.optparse_list, dest="ips",
+ parser.add_option("-N","--nodes",action="callback", callback=TestMain.optparse_list, dest="node_ips",
nargs=1,type="string",
- help="Specify the set of IP addresses to use in vserver mode (disable scanning)")
+ help="Specify the set of IP addresses to use for nodes (scanning disabled)")
+ parser.add_option("-P","--plcs",action="callback", callback=TestMain.optparse_list, dest="plc_ips",
+ nargs=1,type="string",
+ help="Specify the set of IP addresses to use for plcs (scanning disabled)")
parser.add_option("-1","--small",action="store_true",dest="small_test",default=False,
help="run a small test -- typically only one node")
parser.add_option("-d","--dbname",action="store",dest="dbname",default=None,
# handle defaults and option persistence
for (recname,filename,default) in (
('build_url','arg-build-url',TestMain.default_build_url) ,
- ('ips','arg-ips',[]) ,
+ ('node_ips','arg-node-ips',[]) ,
+ ('plc_ips','arg-plc-ips',[]) ,
('config','arg-config',TestMain.default_config) ,
('arch_rpms_url','arg-arch-rpms-url',"") ,
) :
'check_initscripts', 'check_tcp',SEP,
'force_gather_logs', 'force_kill_qemus', 'force_record_tracker','force_free_tracker' ]
other_steps = [ 'stop_all_vservers','fresh_install', 'cache_rpm', 'stop', SEP,
- 'clean_sites', 'clean_nodes', 'clean_slices', 'clean_keys', SEP,
+ 'clean_initscripts', 'clean_sites', 'clean_nodes',
+ 'clean_slices', 'clean_keys', SEP,
'show_boxes', 'list_all_qemus', 'list_qemus', SEP,
'db_dump' , 'db_restore', ' cleanup_tracker',
'standby_1 through 20'
self.apiserver.AddInitScript(self.auth_root(),initscript['initscript_fields'])
return True
+ def clean_initscripts (self):
+ for initscript in self.plc_spec['initscripts']:
+ initscript_name = initscript['initscript_fields']['name']
+ print('Attempting to delete %s in plc %s'%(initscript_name,self.plc_spec['name']))
+ try:
+ self.apiserver.DeleteInitScript(self.auth_root(),initscript_name)
+ print initscript_name,'deleted'
+ except:
+ print 'deletion went wrong - probably did not exist'
+ return True
+
def slices (self):
return self.do_slices()
all_nodenames = test_mapper.node_names()
maps = []
for nodename in all_nodenames:
- if len(options.ips) != 0:
- ip=options.ips[0]
- options.ips=options.ips[1:]
+ if len(options.node_ips) != 0:
+ ip=options.node_ips[0]
+ options.node_ips=options.node_ips[1:]
(hostname,ip,mac)=test_pool.locate(ip)
else:
(hostname,ip,mac) = test_pool.next_free()
test_pool = TestPool (onelab_plcs_pool,options)
- if len(options.ips) != 0:
- utils.header('Using user-provided IPS:\nips=%r'%options.ips)
- options.ips.reverse()
+ if len(options.plc_ips) != 0:
+ utils.header('Using user-provided IPS:\nplc_ips=%r'%options.plc_ips)
+ options.plc_ips.reverse()
plc_counter=0
for plc in plcs:
try:
- if len(options.ips) != 0:
- ip=options.ips[0]
- options.ips=options.ips[1:]
+ if len(options.plc_ips) != 0:
+ ip=options.plc_ips[0]
+ options.plc_ips=options.plc_ips[1:]
(hostname,ip,mac)=test_pool.locate(ip)
utils.header("Using user-provided %s %s for plc %s"%(
hostname,ip,plc['name']))