import repository from arizona
[raven.git] / apps / mprepo / test_compat.py
1 #!/usr/bin/env python
2
3 #           [option, long option,                    variable,            action,        data,     default,                            metavar,    description]
4 """arizonaconfig
5    options=[
6             ["",   "--managerconf",        "managerconf",        "store",    "string",    "~/.storkmanager.conf",               "FILE",      "use a different config file (~/.storkmanager.conf is the default)"],
7             ["",   "--repositoryhost",     "repositoryhost",     "store",    "string",    "stork-repository.cs.arizona.edu",    "FILE",      "use a different repository (among other repository settings) (stork-repository.cs.arizona.edu is the default)"],
8             ["",   "--curlpath",           "curlpath",           "store",    "string",    "/usr/bin/curl",                      "FILE",      "the path to the curl executable (/usr/bin/curl is the default)"],
9
10             ["",   "--testusername",           "testusername",           "store",    "string",    None,                                 "NAME",      "pl username"],
11             ["",   "--testpassword",           "testpassword",           "store",    "string",    None,                                 "NAME",      "pl password"]
12    ]
13    includes=[]
14 """
15
16
17 import arizonaconfig
18 import storkcurlfuncs
19
20 storkcurlfuncs.repository = "localhost"
21 storkcurlfuncs.repoport = ""
22
23 def main():
24     arizonaconfig.init_options('test_compat.py', usage="", configfile_optvar='managerconf', version='2.0')
25
26     username = arizonaconfig.get_option("testusername")
27     password = arizonaconfig.get_option("testpassword")
28
29     if (not username) or (not password):
30         print "specify --testusername and --testpassword"
31         return
32
33     slice = "arizona_client2"
34     nodes = ["planetlab1.cs.arizona.edu", "planetlab2.cs.arizona.edu"]
35
36     print "Calling login:"
37     result = storkcurlfuncs.login(username, password)
38
39     print "Calling getslices:"
40     result = storkcurlfuncs.getslices()
41     print result
42
43     print "Calling autosetup:"
44     result = storkcurlfuncs.autoSetup(username, password, slice, nodes, "www.planet-lab.org")
45     print result
46
47 if __name__ == "__main__":
48     main()