better customization of SA test script
[sfa.git] / cmdline / testSA.sh
1 # The following lines use the root account of the MyPLC. This assumes that the
2 # Administrator_Default has a private key that is located in the file
3 # root.pkey in the current directory.
4 USERNAME=root
5 PARENT_HRN=planetlab.us.pl
6 USER_HRN=$PARENT_HRN.Administrator_Default
7
8 # The following lines use Tony Mack's planetlab account on a live PLC
9 # database (tony: copy your private key to tmack.pkey in the current directory)
10 #USERNAME=tmack
11 #PARENT_HRN=planetlab.us.princeton
12 #USER_HRN=$PARENT_HRN.Mack_Tony
13
14 TEST_USER_HRN=$PARENT_HRN.testuser
15 TEST_SLICE_HRN=$PARENT_HRN.testslice1
16 TEST_NODE_HRN=$PARENT_HRN.testnode1
17
18 TEST_NODE_IP=198.0.0.133
19
20 rm -f root.cred
21 rm -f root.cert
22 rm -f rootsa.cred
23 rm -f testkey.pkey
24 rm -f testkey.gid
25
26 echo XXXXX -------------------------------------------------------------------
27 echo XXXXX Getting Self Credential
28 python ./genicli.py --username $USERNAME --credfile None --outfile root.cred getCredential user $USER_HRN
29
30 echo XXXXX -------------------------------------------------------------------
31 echo XXXXX Resolving Self
32 python ./genicli.py --username $USERNAME resolve $USER_HRN
33
34 echo XXXXX -------------------------------------------------------------------
35 echo XXXXX Getting SA Credential
36 python ./genicli.py --username $USERNAME --outfile rootsa.cred getCredential sa $PARENT_HRN
37
38 echo XXXXX -------------------------------------------------------------------
39 echo XXXXX List records in an authority
40 python ./genicli.py --username $USERNAME --credfile rootsa.cred list
41
42 echo XXXXX -------------------------------------------------------------------
43 echo XXXXX Create a private key
44 python ./genicli.py --username testkey createKey
45
46 echo XXXXX -------------------------------------------------------------------
47 echo XXXXX Create a GID for a user
48 python ./genicli.py --username $USERNAME --credfile rootsa.cred --outfile testuser.gid createGid $TEST_USER_HRN None testkey.pkey
49
50 echo XXXXX -------------------------------------------------------------------
51 echo XXXXX Create a GID for a slice
52 python ./genicli.py --username $USERNAME --credfile rootsa.cred --outfile testslice.gid createGid $TEST_SLICE_HRN None testkey.pkey
53
54 echo XXXXX -------------------------------------------------------------------
55 echo XXXXX Create a GID for a node
56 python ./genicli.py --username $USERNAME --credfile rootsa.cred --outfile testnode.gid createGid $TEST_NODE_HRN None testkey.pkey
57
58 echo XXXXX -------------------------------------------------------------------
59 echo XXXXX Register a user
60 python ./genicli.py --username $USERNAME --credfile rootsa.cred --email test1234@test.com register user $TEST_USER_HRN testuser.gid
61
62 echo XXXXX -------------------------------------------------------------------
63 echo XXXXX Resolve the test user
64 python ./genicli.py --username $USERNAME --credfile rootsa.cred resolve $TEST_USER_HRN
65
66 echo XXXXX -------------------------------------------------------------------
67 echo XXXXX Register a slice
68 python ./genicli.py --username $USERNAME --credfile rootsa.cred register slice $TEST_SLICE_HRN testslice.gid
69
70 echo XXXXX -------------------------------------------------------------------
71 echo XXXXX Resolve the test slice
72 python ./genicli.py --username $USERNAME --credfile rootsa.cred resolve $TEST_SLICE_HRN
73
74 echo XXXXX -------------------------------------------------------------------
75 echo XXXXX Register a node
76 python ./genicli.py --username $USERNAME --credfile rootsa.cred --ip $TEST_NODE_IP --dns testnode1.lan register node $TEST_NODE_HRN testnode.gid
77
78 echo XXXXX -------------------------------------------------------------------
79 echo XXXXX Resolve the test node
80 python ./genicli.py --username $USERNAME --credfile rootsa.cred resolve $TEST_NODE_HRN
81
82 echo XXXXX -------------------------------------------------------------------
83 echo XXXXX Remove the test node
84 python ./genicli.py --username $USERNAME --credfile rootsa.cred remove node $TEST_NODE_HRN
85
86 echo XXXXX -------------------------------------------------------------------
87 echo XXXXX Remove the test slice
88 python ./genicli.py --username $USERNAME --credfile rootsa.cred remove slice $TEST_SLICE_HRN
89
90 echo XXXXX -------------------------------------------------------------------
91 echo XXXXX Remove a user
92 python ./genicli.py --username $USERNAME --credfile rootsa.cred remove user $TEST_USER_HRN