rewrote component test script to use a ticket to create slice
[sfa.git] / cmdline / testComponent.sh
1 # Assumptions:
2 #    planetlab.us.pl.account_test is a user that exists on the registry
3 #    planetlab.us.pl.test1 (pl_test1) is a slice that exists on the node
4
5 rm -f test.cred
6 rm -f test.cert
7 rm -f pltest1.cred
8
9 NODE_URL=https://198.0.0.131:12345/
10
11 SA_CRED_NAME=rootsa.cred
12
13 SLICE_KEY_NAME=testcw
14 SLICE_KEY_FN=$SLICE_KEY_NAME.pkey
15
16 SLICE_NAME=planetlab.us.pl.testcw
17 SLICE_CRED_NAME=testcw.cred
18 SLICE_TICKET_NAME=testcw.ticket
19 SLICE_GID_NAME=testcw.gid
20
21 echo XXXXX -------------------------------------------------------------------
22 echo XXXXX Getting User Credential
23 python ./genicli.py --username test --credfile None --outfile test.cred getCredential user planetlab.us.pl.account_test
24
25 echo XXXXX -------------------------------------------------------------------
26 echo XXXXX Create a private key
27 python ./genicli.py --username $SLICE_KEY_NAME createKey
28
29 echo XXXXX -------------------------------------------------------------------
30 echo XXXXX Getting SA Credential
31 python ./genicli.py --username root --outfile $SA_CRED_NAME getCredential sa planetlab.us.pl
32
33 echo XXXXX -------------------------------------------------------------------
34 echo XXXXX Create a GID for a slice
35 python ./genicli.py --username root --credfile rootsa.cred --outfile $SLICE_GID_NAME createGid $SLICE_NAME None $SLICE_KEY_FN
36
37 echo XXXXX -------------------------------------------------------------------
38 echo XXXXX If the test slice already exists, Remove the test slice
39 python ./genicli.py --username root --credfile $SA_CRED_NAME remove slice $SLICE_NAME
40
41 echo XXXXX -------------------------------------------------------------------
42 echo XXXXX Register a slice
43 python ./genicli.py --username root --credfile $SA_CRED_NAME register slice $SLICE_NAME $SLICE_GID_NAME
44
45 echo XXXXX -------------------------------------------------------------------
46 echo XXXXX Get Slice Credential
47 python ./genicli.py --username test --outfile $SLICE_CRED_NAME getCredential slice $SLICE_NAME
48
49 echo XXXXX -------------------------------------------------------------------
50 echo XXXXX Get a Ticket
51 python ./genicli.py --username test --credfile $SLICE_CRED_NAME --outfile $SLICE_TICKET_NAME getTicket $SLICE_NAME
52
53 echo XXXXX -------------------------------------------------------------------
54 echo XXXXX Redeem a Ticket
55 python ./genicli.py --server $NODE_URL --username test --ticketfile $SLICE_TICKET_NAME redeemTicket
56
57 echo XXXXX -------------------------------------------------------------------
58 echo XXXXX Stop a Slice
59 python ./genicli.py --server $NODE_URL --username test --credfile $SLICE_CRED_NAME stopSlice
60
61 echo XXXXX -------------------------------------------------------------------
62 echo XXXXX Start a Slice
63 python ./genicli.py --server $NODE_URL --username test --credfile $SLICE_CRED_NAME startSlice
64
65 echo XXXXX -------------------------------------------------------------------
66 echo XXXXX Reset a Slice
67 python ./genicli.py --server $NODE_URL --username test --credfile $SLICE_CRED_NAME resetSlice
68
69 echo XXXXX -------------------------------------------------------------------
70 echo XXXXX Delete a Slice
71 python ./genicli.py --server $NODE_URL --username test --credfile $SLICE_CRED_NAME deleteSlice
72
73 echo XXXXX -------------------------------------------------------------------
74 echo XXXXX List Slices
75 python ./genicli.py --server $NODE_URL --username test --credfile $SLICE_CRED_NAME listSlices