-"""%(TestMain.default_build_url,TestMain.default_config)
- usage += steps_message
- parser=OptionParser(usage=usage,version=self.subversion_id)
- parser.add_option("-u","--url",action="store", dest="arch_rpms_url",
- help="URL of the arch-dependent RPMS area - for locating what to test")
- parser.add_option("-b","--build",action="store", dest="build_url",
- help="Build URL - for locating vtest-init-vserver.sh")
- parser.add_option("-c","--config",action="callback", callback=TestMain.optparse_list, dest="config",
- nargs=1,type="string",
- help="Config module - can be set multiple times, or use quotes")
- parser.add_option("-p","--personality",action="store", dest="personality",
- help="personality - as in vbuild-nightly")
- parser.add_option("-d","--pldistro",action="store", dest="pldistro",
- help="pldistro - as in vbuild-nightly")
- parser.add_option("-f","--fcdistro",action="store", dest="fcdistro",
- help="fcdistro - as in vbuild-nightly")
- parser.add_option("-x","--exclude",action="callback", callback=TestMain.optparse_list, dest="exclude",
- nargs=1,type="string",default=[],
- help="steps to exclude - can be set multiple times, or use quotes")
- parser.add_option("-a","--all",action="store_true",dest="all_steps", default=False,
- 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("-N","--nodes",action="callback", callback=TestMain.optparse_list, dest="ips_node",
- nargs=1,type="string",
- 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="ips_plc",
- nargs=1,type="string",
- help="Specify the set of IP addresses to use for plcs (scanning disabled)")
- parser.add_option("-s","--size",action="store",type="int",dest="size",default=1,
- help="sets test size in # of plcs - default is 1")
- parser.add_option("-D","--dbname",action="store",dest="dbname",default=None,
- help="Used by db_dump and db_restore")
- parser.add_option("-v","--verbose", action="store_true", dest="verbose", default=False,
- help="Run in verbose mode")
- parser.add_option("-q","--quiet", action="store_true", dest="quiet", default=False,
- help="Run in quiet mode")
- parser.add_option("-i","--interactive",action="store_true",dest="interactive",default=False,
- help="prompts before each step")
- parser.add_option("-n","--dry-run", action="store_true", dest="dry_run", default=False,
- help="Show environment and exits")
- parser.add_option("-r","--restart-nm", action="store_true", dest="forcenm", default=False,
- help="Force the NM to restart in check_slices step")
- parser.add_option("-t","--trace", action="store", dest="trace_file", default=None,
- #default="logs/trace-@TIME@.txt",
- help="Trace file location")
- (self.options, self.args) = parser.parse_args()
- if self.options.quiet:
- self.options.verbose=False
-
- if len(self.args) == 0:
- if self.options.all_steps:
- self.options.steps=TestPlc.default_steps
- elif self.options.dry_run:
- self.options.steps=TestPlc.default_steps
- elif self.options.list_steps:
- print steps_message
+""".format(TestMain.default_config)
+
+ parser = ArgumentParser(usage = usage)
+ parser.add_argument("-u", "--url", action="store", dest="arch_rpms_url",
+ help="URL of the arch-dependent RPMS area - for locating what to test")
+ parser.add_argument("-b", "--build", action="store", dest="build_url",
+ help="ignored, for legacy only")
+ parser.add_argument("-c", "--config", action="append", dest="config", default=[],
+ help="Config module - can be set multiple times, or use quotes")
+ parser.add_argument("-p", "--personality", action="store", dest="personality",
+ help="personality - as in vbuild-nightly")
+ parser.add_argument("-d", "--pldistro", action="store", dest="pldistro",
+ help="pldistro - as in vbuild-nightly")
+ parser.add_argument("-f", "--fcdistro", action="store", dest="fcdistro",
+ help="fcdistro - as in vbuild-nightly")
+ parser.add_argument("-e", "--exclude", action="append", dest="exclude", default=[],
+ help="steps to exclude - can be set multiple times, or use quotes")
+ parser.add_argument("-i", "--ignore", action="append", dest="ignore", default=[],
+ help="steps to run but ignore - can be set multiple times, or use quotes")
+ parser.add_argument("-a", "--all", action="store_true", dest="all_steps", default=False,
+ help="Run all default steps")
+ parser.add_argument("-l", "--list", action="store_true", dest="list_steps", default=False,
+ help="List known steps")
+ parser.add_argument("-V", "--vserver", action="append", dest="ips_bplc", default=[],
+ help="Specify the set of hostnames for the boxes that host the plcs")
+ parser.add_argument("-P", "--plcs", action="append", dest="ips_vplc", default=[],
+ help="Specify the set of hostname/IP's to use for vplcs")
+ parser.add_argument("-Q", "--qemus", action="append", dest="ips_bnode", default=[],
+ help="Specify the set of hostnames for the boxes that host the nodes")
+ parser.add_argument("-N", "--nodes", action="append", dest="ips_vnode", default=[],
+ help="Specify the set of hostname/IP's to use for vnodes")
+ parser.add_argument("-s", "--size", action="store", dest="size", default=1,
+ type=int,
+ help="set test size in # of plcs - default is 1")
+ parser.add_argument("-q", "--qualifier", action="store", dest="qualifier", default=None,
+ type=int,
+ help="run steps only on plc numbered <qualifier>, starting at 1")
+ parser.add_argument("-y", "--rspec-style", action="append", dest="rspec_styles", default=[],
+ help="OBSOLETE - for compat only")
+ parser.add_argument("-k", "--keep-going", action="store", dest="keep_going", default=False,
+ help="proceeds even if some steps are failing")
+ parser.add_argument("-D", "--dbname", action="store", dest="dbname", default=None,
+ help="Used by plc_db_dump and plc_db_restore")
+ parser.add_argument("-v", "--verbose", action="store_true", dest="verbose", default=False,
+ help="Run in verbose mode")
+ parser.add_argument("-I", "--interactive", action="store_true", dest="interactive", default=False,
+ help="prompts before each step")
+ parser.add_argument("-n", "--dry-run", action="store_true", dest="dry_run", default=False,
+ help="Show environment and exits")
+ parser.add_argument("-t", "--trace", action="store", dest="trace_file", default=None,
+ help="Trace file location")
+ parser.add_argument("-g", "--bonding", action='store', dest='bonding_build', default=None,
+ help="specify build to bond with")
+ # if we call symlink 'rung' instead of just run this is equivalent to run -G
+ bonding_default = 'rung' in sys.argv[0]
+ parser.add_argument("-G", "--bonding-env", action='store_true', dest='bonding_env', default=bonding_default,
+ help="get bonding build from env. variable $bonding")
+ parser.add_argument("steps", nargs='*')
+ self.options = parser.parse_args()
+
+ # handle -G/-g options
+ if self.options.bonding_env:
+ if 'bonding' not in os.environ:
+ print("env. variable $bonding must be set with --bonding-env")