Exemple #1
0
def parse_commandline():
    """
    general function for parsing command line args given to the unit-test.
    """
    my_parser = argparse.ArgumentParser(parents = [afs.ARGPARSER], \
        add_help = False,epilog = afs.ARGPARSER.epilog)
    my_parser.add_argument("--setup", default="./Test.cfg", \
        help="path to Testconfig")
    my_parser.add_argument("--harmless_auth", dest="enable_harmless_auth_tests", action='store_const', const=True, \
      default=False, help="enable harmless tests requiring authentication")
    my_parser.add_argument("--destructive", dest="enable_destructive_tests", action='store_const', const=True, \
      default=False, help="enable destructive tests")
    my_parser.add_argument("--modifying", dest="enable_modifying_tests", action='store_const', const=True, \
      default=False, help="enable modifying tests")
    my_parser.add_argument("--interrupting", dest="enable_interrupting_tests", action='store_const', const=True, \
      default=False, help="enable interrupting tests")
   
    parse_configs(my_parser)
    if not os.path.exists(afs.CONFIG.setup) :
        sys.stderr.write("Test setup file %s does not exist.\n" % \
            afs.CONFIG.setup)
        sys.exit(2)
    return
Exemple #2
0
from afs.service.FSService import FSService
from afs.service.VolumeService import VolumeService

import time



my_parser = argparse.ArgumentParser(parents = [afs.ARGPARSER], \
    add_help = False,epilog = afs.ARGPARSER.epilog)
my_parser.add_argument("--src_srv", required=True,\ 
    help="source-server")
my_parser.add_argument("--dst_srv", required=True,\ 
    help="destination-server")

#put all cmd-line options into afs.CONFIG
parse_configs(my_parser)


FSS = FSService()
VolS = VolumeService()

# get fileserver objects
src_fs = FSS.get_fileserver(afs.CONFIG.src_srv)
dst_fs = FSS.get_fileserver(afs.CONFIG.dst_srv)


# get list of all volumes on this fileserver
volume_list = FSS.get_volume_list(src_fs)

# move loop
move_count = 0