<s> """<STR_LIT>""" <EOL> import copy <EOL> import datetime <EOL> import optparse <EOL> import sys <EOL> import colors <EOL> import qa_cluster <EOL> import qa_config <EOL> import qa_daemon <EOL> import qa_env <EOL> import qa_error <EOL> import qa_filters <EOL> import qa_group <EOL> import qa_global_hooks <EOL> import qa_instance <EOL> import qa_iptables <EOL> import qa_maintd <EOL> import qa_monitoring <EOL> import qa_network <EOL> import qa_node <EOL> import qa_os <EOL> import qa_performance <EOL> import qa_job <EOL> import qa_rapi <EOL> import qa_tags <EOL> import qa_utils <EOL> from ganeti import utils <EOL> from ganeti import rapi <EOL> from ganeti import constants <EOL> from ganeti import netutils <EOL> import ganeti . rapi . client <EOL> from ganeti . rapi . client import UsesRapiClient <EOL> def _FormatHeader ( line , end = <NUM_LIT> , mark = "<STR_LIT:->" , color = None ) : <EOL> """<STR_LIT>""" <EOL> line = ( mark * <NUM_LIT:4> ) + "<STR_LIT:U+0020>" + line + "<STR_LIT:U+0020>" <EOL> line += "<STR_LIT:->" * ( end - len ( line ) ) <EOL> line = line . rstrip ( ) <EOL> line = colors . colorize ( line , color = color ) <EOL> return line <EOL> def _DescriptionOf ( fn ) : <EOL> """<STR_LIT>""" <EOL> if fn . __doc__ : <EOL> desc = fn . __doc__ . splitlines ( ) [ <NUM_LIT:0> ] . strip ( ) <EOL> desc = desc . rstrip ( "<STR_LIT:.>" ) <EOL> if fn . __name__ : <EOL> desc = "<STR_LIT:[>" + fn . __name__ + "<STR_LIT>" + desc <EOL> else : <EOL> desc = "<STR_LIT>" % fn <EOL> return desc <EOL> def RunTest ( fn , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> tstart = datetime . datetime . now ( ) <EOL> desc = _DescriptionOf ( fn ) <EOL> print <EOL> print _FormatHeader ( "<STR_LIT>" % ( tstart , desc ) , <EOL> color = colors . YELLOW , mark = "<STR_LIT:<>" ) <EOL> try : <EOL> retval = fn ( * args , ** kwargs ) <EOL> print _FormatHeader ( "<STR_LIT>" % ( desc , ) , color = colors . GREEN ) <EOL> return retval <EOL> except Exception , e : <EOL> print _FormatHeader ( "<STR_LIT>" % ( desc , e ) , color = colors . RED ) <EOL> raise <EOL> finally : <EOL> tstop = datetime . datetime . now ( ) <EOL> tdelta = tstop - tstart <EOL> print _FormatHeader ( "<STR_LIT>" % ( tstop , tdelta , desc ) , <EOL> color = colors . MAGENTA , mark = "<STR_LIT:>>" ) <EOL> def ReportTestSkip ( desc , testnames ) : <EOL> """<STR_LIT>""" <EOL> tstart = datetime . datetime . now ( ) <EOL> print _FormatHeader ( "<STR_LIT>" % <EOL> ( tstart , desc , testnames ) , <EOL> color = colors . BLUE , mark = "<STR_LIT:*>" ) <EOL> def RunTestIf ( testnames , fn , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if qa_config . TestEnabled ( testnames ) : <EOL> RunTest ( fn , * args , ** kwargs ) <EOL> else : <EOL> desc = _DescriptionOf ( fn ) <EOL> ReportTestSkip ( desc , testnames ) <EOL> def RunTestBlock ( fn , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> tstart = datetime . datetime . now ( ) <EOL> desc = _DescriptionOf ( fn ) <EOL> print <EOL> print _FormatHeader ( "<STR_LIT>" % ( tstart , desc ) , <EOL> color = [ colors . YELLOW , colors . BOLD ] , mark = "<STR_LIT:v>" ) <EOL> try : <EOL> return fn ( * args , ** kwargs ) <EOL> except Exception , e : <EOL> print _FormatHeader ( "<STR_LIT>" % ( desc , e ) , <EOL> color = [ colors . RED , colors . BOLD ] ) <EOL> raise <EOL> finally : <EOL> tstop = datetime . datetime . now ( ) <EOL> tdelta = tstop - tstart <EOL> print _FormatHeader ( "<STR_LIT>" % ( tstop , tdelta , desc ) , <EOL> color = [ colors . MAGENTA , colors . BOLD ] , mark = "<STR_LIT>" ) <EOL> def RunEnvTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_env . TestSshConnection ) <EOL> RunTestIf ( "<STR_LIT>" , qa_env . TestIcmpPing ) <EOL> RunTestIf ( "<STR_LIT>" , qa_env . TestGanetiCommands ) <EOL> def SetupCluster ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestClusterInit ) <EOL> if not qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> qa_config . SetExclusiveStorage ( qa_config . get ( "<STR_LIT>" , False ) ) <EOL> qa_rapi . SetupRapi ( ) <EOL> qa_group . ConfigureGroups ( ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_job . TestJobList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeAddAll ) <EOL> if not qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> qa_node . MarkNodeAddedAll ( ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestJobqueue ) <EOL> RunTestIf ( "<STR_LIT>" , qa_job . TestJobCancellation ) <EOL> RunTest ( qa_daemon . TestResumeWatcher ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeListFields ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceListFields ) <EOL> RunTestIf ( "<STR_LIT>" , qa_job . TestJobListFields ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestBackupListFields ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeInfo ) <EOL> def RunClusterTests ( ) : <EOL> """<STR_LIT>""" <EOL> for test , fn in [ <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterInitDisk ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterRenewCrypto ) <EOL> ] : <EOL> RunTestIf ( test , fn ) <EOL> for test , fn in [ <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterVerify ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterReservedLvs ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyEmpty ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyIPolicy ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyISpecs ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyBe ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyDisk ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyDiskTemplates ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyFileStorageDir ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifySharedFileStorageDir ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyInstallImage ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterModifyUserShutdown ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterRename ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterVersion ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterInfo ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterGetmaster ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterRedistConf ) , <EOL> ( [ "<STR_LIT>" , qa_config . NoVirtualCluster ] , <EOL> qa_cluster . TestClusterCopyfile ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterCommand ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterBurnin ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestClusterMasterFailover ) , <EOL> ( "<STR_LIT>" , <EOL> qa_cluster . TestClusterMasterFailoverWithDrainedQueue ) , <EOL> ( [ "<STR_LIT>" , qa_config . NoVirtualCluster ] , <EOL> qa_cluster . TestClusterOob ) , <EOL> ( "<STR_LIT>" , qa_cluster . TestInstanceCommunication ) , <EOL> ( qa_rapi . Enabled , qa_rapi . TestVersion ) , <EOL> ( qa_rapi . Enabled , qa_rapi . TestEmptyCluster ) , <EOL> ( qa_rapi . Enabled , qa_rapi . TestRapiQuery ) , <EOL> ] : <EOL> RunTestIf ( test , fn ) <EOL> def RunRepairDiskSizes ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestClusterRepairDiskSizes ) <EOL> def RunOsTests ( ) : <EOL> """<STR_LIT>""" <EOL> os_enabled = [ "<STR_LIT>" , qa_config . NoVirtualCluster ] <EOL> if qa_config . TestEnabled ( qa_rapi . Enabled ) : <EOL> rapi_getos = qa_rapi . GetOperatingSystems <EOL> else : <EOL> rapi_getos = None <EOL> for fn in [ <EOL> qa_os . TestOsList , <EOL> qa_os . TestOsDiagnose , <EOL> ] : <EOL> RunTestIf ( os_enabled , fn ) <EOL> for fn in [ <EOL> qa_os . TestOsValid , <EOL> qa_os . TestOsInvalid , <EOL> qa_os . TestOsPartiallyValid , <EOL> ] : <EOL> RunTestIf ( os_enabled , fn , rapi_getos ) <EOL> for fn in [ <EOL> qa_os . TestOsModifyValid , <EOL> qa_os . TestOsModifyInvalid , <EOL> qa_os . TestOsStatesNonExisting , <EOL> ] : <EOL> RunTestIf ( os_enabled , fn ) <EOL> def RunCommonInstanceTests ( instance , inst_nodes ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceShutdown , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiStoppedInstanceConsole , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" ] , <EOL> qa_instance . TestInstanceStoppedModify , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceStartup , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceShutdown , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceStartup , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceInfo , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceModify , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceModify , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceConsole , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceConsole , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceDeviceNames , <EOL> instance ) <EOL> DOWN_TESTS = qa_config . Either ( [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ] ) <EOL> RunTestIf ( DOWN_TESTS , qa_instance . TestInstanceShutdown , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceReinstall , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceReinstall , instance ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> tgt_instance = qa_config . AcquireInstance ( ) <EOL> try : <EOL> rename_source = instance . name <EOL> rename_target = tgt_instance . name <EOL> RunTest ( qa_instance . TestInstanceRenameAndBack , <EOL> rename_source , rename_source ) <EOL> RunTestIf ( qa_rapi . Enabled , qa_rapi . TestRapiInstanceRenameAndBack , <EOL> rename_source , rename_source ) <EOL> if rename_target is not None : <EOL> RunTest ( qa_instance . TestInstanceRenameAndBack , <EOL> rename_source , rename_target ) <EOL> RunTestIf ( qa_rapi . Enabled , qa_rapi . TestRapiInstanceRenameAndBack , <EOL> rename_source , rename_target ) <EOL> finally : <EOL> tgt_instance . Release ( ) <EOL> RunTestIf ( [ "<STR_LIT>" ] , qa_instance . TestInstanceGrowDisk , instance ) <EOL> RunTestIf ( DOWN_TESTS , qa_instance . TestInstanceStartup , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceReboot , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_tags . TestInstanceTags , instance ) <EOL> if instance . disk_template == constants . DT_DRBD8 : <EOL> RunTestIf ( "<STR_LIT>" , <EOL> qa_cluster . TestClusterVerifyDisksBrokenDRBD , instance , inst_nodes ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestClusterVerify ) <EOL> RunTestIf ( qa_rapi . Enabled , qa_rapi . TestInstance , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_job . TestJobList ) <EOL> def RunCommonNodeTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeVolumes ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeStorage ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_config . NoVirtualCluster ] , qa_node . TestOutOfBand ) <EOL> def RunGroupListTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestGroupList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestGroupListFields ) <EOL> def RunNetworkTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_network . TestNetworkAddRemove ) <EOL> RunTestIf ( "<STR_LIT>" , qa_network . TestNetworkConnect ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" ] , qa_network . TestNetworkTags ) <EOL> def RunFilterTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterList ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterListFields ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterAddRemove ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterReject ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterOpCode ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterReasonChain ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterContinue ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterAcceptPause ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterWatermark ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestFilterRateLimit ) <EOL> RunTestIf ( "<STR_LIT>" , qa_filters . TestAdHocReasonRateLimit ) <EOL> def RunGroupRwTests ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestGroupAddRemoveRename ) <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestGroupAddWithOptions ) <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestGroupModify ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , qa_rapi . TestRapiNodeGroups ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" ] , qa_tags . TestGroupTags , <EOL> qa_group . GetDefaultGroup ( ) ) <EOL> def RunExportImportTests ( instance , inodes ) : <EOL> """<STR_LIT>""" <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> RunTest ( qa_instance . TestInstanceExportNoTarget , instance ) <EOL> pnode = inodes [ <NUM_LIT:0> ] <EOL> expnode = qa_config . AcquireNode ( exclude = pnode ) <EOL> try : <EOL> name = RunTest ( qa_instance . TestInstanceExport , instance , expnode ) <EOL> RunTest ( qa_instance . TestBackupList , expnode ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> newinst = qa_config . AcquireInstance ( ) <EOL> try : <EOL> RunTest ( qa_instance . TestInstanceImport , newinst , pnode , <EOL> expnode , name ) <EOL> RunTest ( qa_instance . TestInstanceStartup , newinst ) <EOL> RunTest ( qa_instance . TestInstanceRemove , newinst ) <EOL> finally : <EOL> newinst . Release ( ) <EOL> finally : <EOL> expnode . Release ( ) <EOL> if ( qa_config . TestEnabled ( [ qa_rapi . Enabled , "<STR_LIT>" ] ) ) : <EOL> newinst = qa_config . AcquireInstance ( ) <EOL> try : <EOL> tnode = qa_config . AcquireNode ( exclude = inodes ) <EOL> try : <EOL> RunTest ( qa_rapi . TestInterClusterInstanceMove , instance , newinst , <EOL> inodes , tnode ) <EOL> finally : <EOL> tnode . Release ( ) <EOL> finally : <EOL> newinst . Release ( ) <EOL> def RunDaemonTests ( instance ) : <EOL> """<STR_LIT>""" <EOL> RunTest ( qa_daemon . TestPauseWatcher ) <EOL> RunTestIf ( "<STR_LIT>" , <EOL> qa_daemon . TestInstanceAutomaticRestart , instance ) <EOL> RunTestIf ( "<STR_LIT>" , <EOL> qa_daemon . TestInstanceConsecutiveFailures , instance ) <EOL> RunTest ( qa_daemon . TestResumeWatcher ) <EOL> def RunHardwareFailureTests ( instance , inodes ) : <EOL> """<STR_LIT>""" <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceFailover , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceFailover , instance ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceMigrate , instance ) <EOL> RunTestIf ( [ "<STR_LIT>" , qa_rapi . Enabled ] , <EOL> qa_rapi . TestRapiInstanceMigrate , instance ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> othernodes = qa_config . AcquireManyNodes ( len ( inodes ) - <NUM_LIT:1> , exclude = inodes ) <EOL> try : <EOL> RunTestIf ( qa_rapi . Enabled , qa_rapi . TestRapiInstanceReplaceDisks , instance ) <EOL> RunTest ( qa_instance . TestReplaceDisks , <EOL> instance , inodes , othernodes ) <EOL> finally : <EOL> qa_config . ReleaseManyNodes ( othernodes ) <EOL> del othernodes <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> try : <EOL> acquirednodes = qa_config . AcquireManyNodes ( len ( inodes ) , exclude = inodes ) <EOL> othernodes = acquirednodes <EOL> except qa_error . OutOfNodesError : <EOL> if len ( inodes ) > <NUM_LIT:1> : <EOL> acquirednodes = [ qa_config . AcquireNode ( exclude = inodes ) ] <EOL> othernodes = acquirednodes + inodes [ : - <NUM_LIT:1> ] <EOL> else : <EOL> raise <EOL> try : <EOL> RunTest ( qa_instance . TestRecreateDisks , <EOL> instance , inodes , othernodes ) <EOL> finally : <EOL> qa_config . ReleaseManyNodes ( acquirednodes ) <EOL> if len ( inodes ) >= <NUM_LIT:2> : <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeEvacuate , inodes [ <NUM_LIT:0> ] , inodes [ <NUM_LIT:1> ] ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeFailover , inodes [ <NUM_LIT:0> ] , inodes [ <NUM_LIT:1> ] ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeMigrate , inodes [ <NUM_LIT:0> ] , inodes [ <NUM_LIT:1> ] ) <EOL> def RunExclusiveStorageTests ( ) : <EOL> """<STR_LIT>""" <EOL> if not qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> return <EOL> node = qa_config . AcquireNode ( ) <EOL> try : <EOL> old_es = qa_cluster . TestSetExclStorCluster ( False ) <EOL> qa_node . TestExclStorSingleNode ( node ) <EOL> qa_cluster . TestSetExclStorCluster ( True ) <EOL> qa_cluster . TestExclStorSharedPv ( node ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> instance1 = qa_instance . TestInstanceAddWithPlainDisk ( [ node ] ) <EOL> try : <EOL> instance2 = qa_instance . TestInstanceAddWithPlainDisk ( [ node ] ) <EOL> try : <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> qa_instance . TestInstanceRemove ( instance2 ) <EOL> qa_instance . TestInstanceRemove ( instance1 ) <EOL> finally : <EOL> instance2 . Release ( ) <EOL> finally : <EOL> instance1 . Release ( ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> snode = qa_config . AcquireNode ( ) <EOL> try : <EOL> qa_cluster . TestSetExclStorCluster ( False ) <EOL> instance = qa_instance . TestInstanceAddWithDrbdDisk ( [ node , snode ] ) <EOL> try : <EOL> qa_cluster . TestSetExclStorCluster ( True ) <EOL> exp_err = [ constants . CV_EINSTANCEUNSUITABLENODE ] <EOL> qa_cluster . AssertClusterVerify ( fail = True , errors = exp_err ) <EOL> qa_instance . TestInstanceRemove ( instance ) <EOL> finally : <EOL> instance . Release ( ) <EOL> finally : <EOL> snode . Release ( ) <EOL> qa_cluster . TestSetExclStorCluster ( old_es ) <EOL> finally : <EOL> node . Release ( ) <EOL> def RunCustomSshPortTests ( ) : <EOL> """<STR_LIT>""" <EOL> if not qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> return <EOL> std_port = netutils . GetDaemonPort ( constants . SSH ) <EOL> port = <NUM_LIT> <EOL> master = qa_config . GetMasterNode ( ) <EOL> with qa_config . AcquireManyNodesCtx ( <NUM_LIT:1> , exclude = master ) as nodes : <EOL> for node in nodes : <EOL> if qa_utils . UsesIPv6Connection ( node . primary , std_port ) : <EOL> print ( "<STR_LIT>" <EOL> "<STR_LIT>" % ( node . primary , ) ) <EOL> return <EOL> for node in nodes : <EOL> qa_node . NodeRemove ( node ) <EOL> with qa_iptables . RulesContext ( ) as r : <EOL> with qa_group . NewGroupCtx ( ) as group : <EOL> qa_group . ModifyGroupSshPort ( r , group , nodes , port ) <EOL> for node in nodes : <EOL> qa_node . NodeAdd ( node , group = group ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> instance1 = qa_instance . TestInstanceAddWithPlainDisk ( nodes ) <EOL> try : <EOL> instance2 = qa_instance . TestInstanceAddWithPlainDisk ( nodes ) <EOL> try : <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> qa_instance . TestInstanceRemove ( instance2 ) <EOL> qa_instance . TestInstanceRemove ( instance1 ) <EOL> finally : <EOL> instance2 . Release ( ) <EOL> finally : <EOL> instance1 . Release ( ) <EOL> for node in nodes : <EOL> qa_node . NodeRemove ( node ) <EOL> for node in nodes : <EOL> qa_node . NodeAdd ( node ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> def _BuildSpecDict ( par , mn , st , mx ) : <EOL> return { <EOL> constants . ISPECS_MINMAX : [ { <EOL> constants . ISPECS_MIN : { par : mn } , <EOL> constants . ISPECS_MAX : { par : mx } , <EOL> } ] , <EOL> constants . ISPECS_STD : { par : st } , <EOL> } <EOL> def _BuildDoubleSpecDict ( index , par , mn , st , mx ) : <EOL> new_spec = { <EOL> constants . ISPECS_MINMAX : [ { } , { } ] , <EOL> } <EOL> if st is not None : <EOL> new_spec [ constants . ISPECS_STD ] = { par : st } <EOL> new_spec [ constants . ISPECS_MINMAX ] [ index ] = { <EOL> constants . ISPECS_MIN : { par : mn } , <EOL> constants . ISPECS_MAX : { par : mx } , <EOL> } <EOL> return new_spec <EOL> def TestIPolicyPlainInstance ( ) : <EOL> """<STR_LIT>""" <EOL> params = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> if not qa_config . IsTemplateSupported ( constants . DT_PLAIN ) : <EOL> print "<STR_LIT>" % constants . DT_PLAIN <EOL> return <EOL> ( _ , old_specs ) = qa_cluster . TestClusterSetISpecs ( ) <EOL> assert len ( old_specs [ constants . ISPECS_MINMAX ] ) == <NUM_LIT:1> <EOL> node = qa_config . AcquireNode ( ) <EOL> try : <EOL> history = [ ] <EOL> instance = qa_instance . TestInstanceAddWithPlainDisk ( [ node ] ) <EOL> try : <EOL> policyerror = [ constants . CV_EINSTANCEPOLICY ] <EOL> for par in params : <EOL> ( iminval , imaxval ) = qa_instance . GetInstanceSpec ( instance . name , par ) <EOL> new_spec = _BuildSpecDict ( par , imaxval + <NUM_LIT:4> , imaxval + <NUM_LIT:4> , imaxval + <NUM_LIT:4> ) <EOL> history . append ( ( None , new_spec , True ) ) <EOL> if iminval > <NUM_LIT:0> : <EOL> if iminval >= <NUM_LIT:4> : <EOL> upper = iminval - <NUM_LIT:4> <EOL> else : <EOL> upper = iminval - <NUM_LIT:1> <EOL> new_spec = _BuildSpecDict ( par , <NUM_LIT:0> , upper , upper ) <EOL> history . append ( ( None , new_spec , True ) ) <EOL> history . append ( ( old_specs , None , False ) ) <EOL> double_specs = copy . deepcopy ( old_specs ) <EOL> double_specs [ constants . ISPECS_MINMAX ] = double_specs [ constants . ISPECS_MINMAX ] * <NUM_LIT:2> <EOL> ( par1 , par2 ) = params [ <NUM_LIT:0> : <NUM_LIT:2> ] <EOL> ( _ , imaxval1 ) = qa_instance . GetInstanceSpec ( instance . name , par1 ) <EOL> ( _ , imaxval2 ) = qa_instance . GetInstanceSpec ( instance . name , par2 ) <EOL> old_minmax = old_specs [ constants . ISPECS_MINMAX ] [ <NUM_LIT:0> ] <EOL> history . extend ( [ <EOL> ( double_specs , None , False ) , <EOL> ( None , <EOL> _BuildDoubleSpecDict ( <NUM_LIT:0> , par1 , imaxval1 + <NUM_LIT:4> , imaxval1 + <NUM_LIT:4> , <EOL> imaxval1 + <NUM_LIT:4> ) , <EOL> False ) , <EOL> ( None , <EOL> _BuildDoubleSpecDict ( <NUM_LIT:1> , par2 , imaxval2 + <NUM_LIT:4> , None , imaxval2 + <NUM_LIT:4> ) , <EOL> True ) , <EOL> ( None , <EOL> _BuildDoubleSpecDict ( <NUM_LIT:0> , par1 , <EOL> old_minmax [ constants . ISPECS_MIN ] [ par1 ] , <EOL> old_specs [ constants . ISPECS_STD ] [ par1 ] , <EOL> old_minmax [ constants . ISPECS_MAX ] [ par1 ] ) , <EOL> False ) , <EOL> ( old_specs , None , False ) , <EOL> ] ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> for ( new_specs , diff_specs , failed ) in history : <EOL> qa_cluster . TestClusterSetISpecs ( new_specs = new_specs , <EOL> diff_specs = diff_specs ) <EOL> if failed : <EOL> qa_cluster . AssertClusterVerify ( warnings = policyerror ) <EOL> else : <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> qa_instance . TestInstanceRemove ( instance ) <EOL> finally : <EOL> instance . Release ( ) <EOL> for ( new_specs , diff_specs , failed ) in history : <EOL> qa_cluster . TestClusterSetISpecs ( new_specs = new_specs , <EOL> diff_specs = diff_specs ) <EOL> if failed : <EOL> qa_instance . TestInstanceAddWithPlainDisk ( [ node ] , fail = True ) <EOL> finally : <EOL> node . Release ( ) <EOL> def IsExclusiveStorageInstanceTestEnabled ( ) : <EOL> test_name = "<STR_LIT>" <EOL> if qa_config . TestEnabled ( test_name ) : <EOL> vgname = qa_config . get ( "<STR_LIT>" , constants . DEFAULT_VG ) <EOL> vgscmd = utils . ShellQuoteArgs ( [ <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , vgname , <EOL> ] ) <EOL> nodes = qa_config . GetConfig ( ) [ "<STR_LIT>" ] <EOL> for node in nodes : <EOL> try : <EOL> pvnum = int ( qa_utils . GetCommandOutput ( node . primary , vgscmd ) ) <EOL> except Exception , e : <EOL> msg = ( "<STR_LIT>" % <EOL> ( node . primary , test_name , e ) ) <EOL> raise qa_error . Error ( msg ) <EOL> if pvnum < <NUM_LIT:2> : <EOL> raise qa_error . Error ( "<STR_LIT>" % <EOL> ( node . primary , pvnum , test_name ) ) <EOL> res = True <EOL> else : <EOL> res = False <EOL> return res <EOL> def RunInstanceTests ( ) : <EOL> """<STR_LIT>""" <EOL> requested_conversions = qa_config . get ( "<STR_LIT>" , [ ] ) <EOL> supported_conversions = set ( requested_conversions ) . difference ( constants . DTS_NOT_CONVERTIBLE_TO ) <EOL> for ( test_name , templ , create_fun , num_nodes ) in qa_instance . available_instance_tests : <EOL> if ( qa_config . TestEnabled ( test_name ) and <EOL> qa_config . IsTemplateSupported ( templ ) ) : <EOL> inodes = qa_config . AcquireManyNodes ( num_nodes ) <EOL> try : <EOL> instance = RunTest ( create_fun , inodes ) <EOL> try : <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceUserDown , <EOL> instance ) <EOL> RunTestIf ( "<STR_LIT>" , <EOL> qa_instance . TestInstanceCommunication , <EOL> instance , <EOL> qa_config . GetMasterNode ( ) ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestClusterEpo ) <EOL> RunDaemonTests ( instance ) <EOL> for node in inodes : <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeListDrbd , node , <EOL> templ == constants . DT_DRBD8 ) <EOL> if len ( inodes ) > <NUM_LIT:1> : <EOL> RunTestIf ( "<STR_LIT>" , qa_group . TestAssignNodesIncludingSplit , <EOL> constants . INITIAL_NODE_GROUP_NAME , <EOL> inodes [ <NUM_LIT:0> ] . primary , inodes [ <NUM_LIT:1> ] . primary ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> if ( len ( supported_conversions ) > <NUM_LIT:1> and <EOL> instance . disk_template in supported_conversions ) : <EOL> RunTest ( qa_instance . TestInstanceShutdown , instance ) <EOL> RunTest ( qa_instance . TestInstanceConvertDiskTemplate , instance , <EOL> supported_conversions ) <EOL> RunTest ( qa_instance . TestInstanceStartup , instance ) <EOL> supported_conversions . clear ( ) <EOL> else : <EOL> test_desc = "<STR_LIT>" % templ <EOL> ReportTestSkip ( test_desc , "<STR_LIT>" ) <EOL> RunTestIf ( "<STR_LIT>" , <EOL> qa_instance . TestInstanceModifyDisks , instance ) <EOL> RunCommonInstanceTests ( instance , inodes ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> othernode = qa_config . AcquireNode ( ) <EOL> RunTest ( qa_instance . TestInstanceModifyPrimaryAndBack , <EOL> instance , inodes [ <NUM_LIT:0> ] , othernode ) <EOL> othernode . Release ( ) <EOL> RunGroupListTests ( ) <EOL> RunExportImportTests ( instance , inodes ) <EOL> RunHardwareFailureTests ( instance , inodes ) <EOL> RunRepairDiskSizes ( ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" ] , <EOL> qa_rapi . TestInstanceDataCensorship , instance , inodes ) <EOL> RunTest ( qa_instance . TestInstanceRemove , instance ) <EOL> finally : <EOL> instance . Release ( ) <EOL> del instance <EOL> finally : <EOL> qa_config . ReleaseManyNodes ( inodes ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> else : <EOL> test_desc = "<STR_LIT>" % templ <EOL> if not qa_config . TestEnabled ( test_name ) : <EOL> ReportTestSkip ( test_desc , test_name ) <EOL> else : <EOL> ReportTestSkip ( test_desc , "<STR_LIT>" % templ ) <EOL> def RunMonitoringTests ( ) : <EOL> RunTestIf ( "<STR_LIT>" , qa_monitoring . TestInstStatusCollector ) <EOL> def RunMaintdTests ( ) : <EOL> if constants . DT_DRBD8 in qa_config . GetEnabledDiskTemplates ( ) : <EOL> RunTestIf ( "<STR_LIT>" , qa_maintd . TestEvacuate ) <EOL> RunTestIf ( "<STR_LIT>" , qa_maintd . TestEvacuateFailover ) <EOL> if constants . ENABLE_RESTRICTED_COMMANDS : <EOL> RunTestIf ( "<STR_LIT>" , qa_maintd . TestLiveRepair ) <EOL> PARALLEL_TEST_DICT = { <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceFailover , <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceMigration , <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceReplaceDisks , <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceReboot , <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceReinstall , <EOL> "<STR_LIT>" : qa_performance . TestParallelInstanceRename , <EOL> } <EOL> def RunPerformanceTests ( ) : <EOL> if not qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> ReportTestSkip ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> return <EOL> qa_utils . AssertCommand ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> RunTest ( qa_performance . TestParallelMaxInstanceCreationPerformance ) <EOL> RunTest ( qa_performance . TestParallelNodeCountInstanceCreationPerformance ) <EOL> instances = qa_performance . CreateAllInstances ( ) <EOL> RunTest ( qa_performance . TestParallelModify , instances ) <EOL> RunTest ( qa_performance . TestParallelInstanceOSOperations , instances ) <EOL> RunTest ( qa_performance . TestParallelInstanceQueries , instances ) <EOL> qa_performance . RemoveAllInstances ( instances ) <EOL> RunTest ( qa_performance . TestJobQueueSubmissionPerformance ) <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> if qa_config . IsTemplateSupported ( constants . DT_DRBD8 ) : <EOL> RunTest ( qa_performance . TestParallelDRBDInstanceCreationPerformance ) <EOL> if qa_config . IsTemplateSupported ( constants . DT_PLAIN ) : <EOL> RunTest ( qa_performance . TestParallelPlainInstanceCreationPerformance ) <EOL> if qa_config . IsTemplateSupported ( constants . DT_DRBD8 ) and qa_config . TestEnabled ( qa_config . Either ( PARALLEL_TEST_DICT . keys ( ) ) ) : <EOL> inodes = qa_config . AcquireManyNodes ( <NUM_LIT:2> ) <EOL> try : <EOL> instance = qa_instance . TestInstanceAddWithDrbdDisk ( inodes ) <EOL> try : <EOL> for ( test_name , test_fn ) in PARALLEL_TEST_DICT . items ( ) : <EOL> RunTestIf ( test_name , test_fn , instance ) <EOL> finally : <EOL> instance . Release ( ) <EOL> qa_instance . TestInstanceRemove ( instance ) <EOL> finally : <EOL> qa_config . ReleaseManyNodes ( inodes ) <EOL> qa_utils . AssertCommand ( [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] ) <EOL> def RunQa ( ) : <EOL> """<STR_LIT>""" <EOL> RunTestBlock ( RunEnvTests ) <EOL> SetupCluster ( ) <EOL> RunTestBlock ( RunClusterTests ) <EOL> RunTestBlock ( RunOsTests ) <EOL> RunTestIf ( "<STR_LIT>" , qa_tags . TestClusterTags ) <EOL> RunTestBlock ( RunCommonNodeTests ) <EOL> RunTestBlock ( RunGroupListTests ) <EOL> RunTestBlock ( RunGroupRwTests ) <EOL> RunTestBlock ( RunNetworkTests ) <EOL> RunTestBlock ( RunFilterTests ) <EOL> RunTestIf ( "<STR_LIT>" , qa_global_hooks . RunGlobalHooksTests ) <EOL> pnode = qa_config . AcquireNode ( exclude = qa_config . GetMasterNode ( ) ) <EOL> try : <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeReadd , pnode ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeModify , pnode ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestDelay , pnode ) <EOL> finally : <EOL> pnode . Release ( ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> pnode = qa_config . AcquireNode ( ) <EOL> try : <EOL> RunTestIf ( "<STR_LIT>" , qa_tags . TestNodeTags , pnode ) <EOL> if qa_rapi . Enabled ( ) : <EOL> RunTest ( qa_rapi . TestNode , pnode ) <EOL> if ( qa_config . TestEnabled ( "<STR_LIT>" ) <EOL> and qa_config . IsTemplateSupported ( constants . DT_PLAIN ) ) : <EOL> for use_client in [ True , False ] : <EOL> rapi_instance = RunTest ( qa_rapi . TestRapiInstanceAdd , pnode , <EOL> use_client ) <EOL> try : <EOL> if qa_config . TestEnabled ( "<STR_LIT>" ) : <EOL> RunCommonInstanceTests ( rapi_instance , [ pnode ] ) <EOL> RunTest ( qa_rapi . TestRapiInstanceRemove , rapi_instance , use_client ) <EOL> finally : <EOL> rapi_instance . Release ( ) <EOL> del rapi_instance <EOL> rapi_instance_one , rapi_instance_two = RunTest ( qa_rapi . TestRapiInstanceMultiAlloc , pnode ) <EOL> try : <EOL> RunTest ( qa_rapi . TestRapiInstanceRemove , rapi_instance_one , True ) <EOL> RunTest ( qa_rapi . TestRapiInstanceRemove , rapi_instance_two , True ) <EOL> finally : <EOL> rapi_instance_one . Release ( ) <EOL> rapi_instance_two . Release ( ) <EOL> finally : <EOL> pnode . Release ( ) <EOL> config_list = [ <EOL> ( "<STR_LIT>" , lambda : None , lambda _ : None ) , <EOL> ( IsExclusiveStorageInstanceTestEnabled , <EOL> lambda : qa_cluster . TestSetExclStorCluster ( True ) , <EOL> qa_cluster . TestSetExclStorCluster ) , <EOL> ] <EOL> for ( conf_name , setup_conf_f , restore_conf_f ) in config_list : <EOL> if qa_config . TestEnabled ( conf_name ) : <EOL> oldconf = setup_conf_f ( ) <EOL> RunTestBlock ( RunInstanceTests ) <EOL> restore_conf_f ( oldconf ) <EOL> pnode = qa_config . AcquireNode ( ) <EOL> try : <EOL> if qa_config . TestEnabled ( [ "<STR_LIT>" , "<STR_LIT>" ] ) : <EOL> for shutdown in [ False , True ] : <EOL> instance = RunTest ( qa_instance . TestInstanceAddWithPlainDisk , [ pnode ] ) <EOL> try : <EOL> expnode = qa_config . AcquireNode ( exclude = pnode ) <EOL> try : <EOL> if shutdown : <EOL> RunTest ( qa_instance . TestInstanceShutdown , instance ) <EOL> RunTest ( qa_instance . TestInstanceExportWithRemove , instance , expnode ) <EOL> RunTest ( qa_instance . TestBackupList , expnode ) <EOL> finally : <EOL> expnode . Release ( ) <EOL> finally : <EOL> instance . Release ( ) <EOL> del expnode <EOL> del instance <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> finally : <EOL> pnode . Release ( ) <EOL> if qa_rapi . Enabled ( ) : <EOL> RunTestIf ( "<STR_LIT>" , qa_rapi . TestFilters ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestUpgrade ) <EOL> RunTestBlock ( RunExclusiveStorageTests ) <EOL> RunTestIf ( [ "<STR_LIT>" , "<STR_LIT>" ] , <EOL> TestIPolicyPlainInstance ) <EOL> RunTestBlock ( RunCustomSshPortTests ) <EOL> RunTestIf ( <EOL> "<STR_LIT>" , <EOL> qa_instance . TestInstanceCreationRestrictedByDiskTemplates ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestInstanceAddOsParams ) <EOL> RunTestIf ( "<STR_LIT>" , qa_instance . TestSecretOsParams ) <EOL> if qa_config . TestEnabled ( [ "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) : <EOL> snode = qa_config . AcquireNode ( exclude = qa_config . GetMasterNode ( ) ) <EOL> try : <EOL> pnode = qa_config . AcquireNode ( exclude = snode ) <EOL> try : <EOL> instance = qa_instance . TestInstanceAddWithDrbdDisk ( [ pnode , snode ] ) <EOL> set_offline = lambda node : qa_node . MakeNodeOffline ( node , "<STR_LIT:yes>" ) <EOL> set_online = lambda node : qa_node . MakeNodeOffline ( node , "<STR_LIT>" ) <EOL> RunTest ( qa_instance . TestRemoveInstanceOfflineNode , instance , snode , <EOL> set_offline , set_online ) <EOL> finally : <EOL> pnode . Release ( ) <EOL> finally : <EOL> snode . Release ( ) <EOL> qa_cluster . AssertClusterVerify ( ) <EOL> RunTestBlock ( RunMonitoringTests ) <EOL> RunTestBlock ( RunMaintdTests ) <EOL> RunPerformanceTests ( ) <EOL> RunTestIf ( "<STR_LIT>" , qa_node . TestNodeRemoveAll ) <EOL> RunTestIf ( "<STR_LIT>" , qa_cluster . TestClusterDestroy ) <EOL> @ UsesRapiClient <EOL> def main ( ) : <EOL> """<STR_LIT>""" <EOL> colors . check_for_colors ( ) <EOL> parser = optparse . OptionParser ( usage = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , dest = "<STR_LIT>" , <EOL> action = "<STR_LIT:store_true>" , <EOL> help = "<STR_LIT>" ) <EOL> ( opts , args ) = parser . parse_args ( ) <EOL> if len ( args ) == <NUM_LIT:1> : <EOL> ( config_file , ) = args <EOL> else : <EOL> parser . error ( "<STR_LIT>" ) <EOL> if not opts . yes_do_it : <EOL> print ( "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> qa_config . Load ( config_file ) <EOL> primary = qa_config . GetMasterNode ( ) . primary <EOL> qa_utils . StartMultiplexer ( primary ) <EOL> print ( "<STR_LIT>" % <EOL> utils . ShellQuoteArgs ( qa_utils . GetSSHCommand ( primary , "<STR_LIT>" ) ) ) <EOL> print ( "<STR_LIT>" % <EOL> utils . ShellQuoteArgs ( qa_utils . GetSSHCommand ( "<STR_LIT>" , "<STR_LIT>" ) ) ) <EOL> try : <EOL> RunQa ( ) <EOL> finally : <EOL> qa_utils . CloseMultiplexers ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
