setting the sfa-0.9-15 tag
[sfa.git] / tests / client / testSfiSliceRegister.sh
1 #!/bin/bash
2
3 export PATH=$PATH:/etc/sfa
4 source sfi_config
5 CWD=$(pwd)
6
7 # private key to use when creating GID for new slice
8 export TEST_KEY=$CWD/testkey.pkey
9
10 export TEST_SLICE_GID=$CWD/testslice.gid
11 export TEST_SLICE_RECORD=$CWD/testslice.record
12 export TEST_SLICE_HRN=$SFI_AUTH.testslice
13
14 rm ~/.sfi/*.cred
15
16 echo XXXXX -------------------------------------------------------------------
17 echo XXXXX Removing the test slice. this will cause an error if the slice does
18 echo XXXXX not exist -- this error can be ignored
19 echo XXXXX -------------------------------------------------------------------
20
21 python $(CWD)/sfi.py remove --type slice $TEST_SLICE_HRN
22
23 echo XXXXX -------------------------------------------------------------------
24 echo XXXXX Creating a record for the test slice
25 echo XXXXX -------------------------------------------------------------------
26
27 python $(CWD)/editRecord.py --hrn $TEST_SLICE_HRN --pubkeyfile $TEST_KEY --type slice --addresearcher $SFI_USER --outfile $TEST_SLICE_RECORD
28
29 echo XXXXX -------------------------------------------------------------------
30 echo XXXXX Adding the test slice, $TEST_SLICE_HRN
31 echo XXXXX -------------------------------------------------------------------
32
33 python $(CWD)/sfi.py add $TEST_SLICE_RECORD
34
35 echo XXXXX -------------------------------------------------------------------
36 echo XXXXX The slice should have one researcher, $SFI_USER
37 echo XXXXX -------------------------------------------------------------------
38
39 python $(CWD)/sfi.py show $TEST_SLICE_HRN
40
41 echo XXXXX -------------------------------------------------------------------
42 echo XXXXX Adding $TEST_USER_2 to the slice researchers
43 echo XXXXX -------------------------------------------------------------------
44
45 python $(CWD)/editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --addresearcher $TEST_USER_2
46
47 echo XXXXX -------------------------------------------------------------------
48 echo XXXXX Updating the slice
49 echo XXXXX -------------------------------------------------------------------
50
51 python $(CWD)/sfi.py update $TEST_SLICE_RECORD
52
53 echo XXXXX -------------------------------------------------------------------
54 echo XXXXX The slice record should now have two users: $SFI_USER, $TEST_USER_2
55 echo XXXXX -------------------------------------------------------------------
56
57 python $(CWD)/sfi.py show $TEST_SLICE_HRN
58
59 echo XXXXX -------------------------------------------------------------------
60 echo XXXXX Removing $SFI_USER from the slice researchers
61 echo XXXXX -------------------------------------------------------------------
62
63 python $(CWD)/editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --delresearcher $SFI_USER
64
65 echo XXXXX -------------------------------------------------------------------
66 echo XXXXX Updating the slice
67 echo XXXXX -------------------------------------------------------------------
68
69 python $(CWD)/sfi.py update $TEST_SLICE_RECORD
70
71 echo XXXXX -------------------------------------------------------------------
72 echo XXXXX The slice record should now have one users: $TEST_USER_2
73 echo XXXXX -------------------------------------------------------------------
74
75 python $(CWD)/sfi.py show $TEST_SLICE_HRN
76
77 echo XXXXX -------------------------------------------------------------------
78 echo XXXXX Updating the slice
79 echo XXXXX ... this verifies escalation from slice_cred to auth_cred
80 echo XXXXX -------------------------------------------------------------------
81
82 rm ~/.sfi/slice_testslice.cred
83 python $(CWD)/sfi.py update $TEST_SLICE_RECORD
84