teardown_cases.wget 5.36 KB
Newer Older
1 2 3
     gmake admin
    set expidx=`echo "select idx from experiments where pid='testproj3' and eid='testexp3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    expidx = $expidx"
     if ( "$expidx" != "" ) then
4 5 6 7 8 9 10 11 12 13 14
    set expstate=`echo "select state from experiments where pid='testproj3' and eid='testexp3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    expstate = $expstate"
     if ( "$expstate" == "terminating" ) then
    echo  "update experiments set state="active" where pid='testproj3' and eid='testexp3'"| ssh $MYBOSS mysql tbdb
     endif
    set explocked=`echo "select expt_locked from experiments"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    explocked = $explocked"
     if ( "$explocked" == "1" ) then
    echo  "update experiments set expt_locked=NULL where pid='testproj3' and eid='testexp3'"| ssh $MYBOSS mysql tbdb
     endif
     if ( "$expstate" == "swapping" ) then
     ssh $MYBOSS ./waitexp testproj3 testexp3 swapped
     endif
15
     if ( "$expstate" != "swapped" ) then
16
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O swapexp.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/swapexp.php3?eid=testexp3&inout=out&pid=testproj3"
17
     endif
18
     ssh $MYBOSS ./waitexp testproj3 testexp3 swapped
19 20
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O endexp.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/endexp.php3?experiment=$expidx"
     else
21
     echo "*** No experiment testproj3/testexp3! ***"
22
     endif
23
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O freenode.php3.html --post-data "canceled=Cancel" "https://myboss.vulnelab.testbed.emulab.net/freenode.php3?node_id=pc84"
Russ Fish's avatar
Russ Fish committed
24 25 26
    set imgidx=`echo "select imageid from images where pid='testproj3' and imagename='testimg3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    imgidx = $imgidx"
     if ( "$imgidx" != "" ) then
     else
27
     echo "*** No image testimg3! ***"
Russ Fish's avatar
Russ Fish committed
28 29 30 31 32
     endif
    set imgidx=`echo "select imageid from images where pid='testproj3' and imagename='testimg3a'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    imgidx = $imgidx"
     if ( "$imgidx" != "" ) then
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deleteimageid.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deleteimageid.php3?imageid=$imgidx"
     else
33
     echo "*** No image testimg3a! ***"
Russ Fish's avatar
Russ Fish committed
34 35 36 37 38
     endif
    set osidx=`echo "select osid from os_info where pid='testproj3' and osname='testosid3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    osidx = $osidx"
     if ( "$osidx" != "" ) then
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deleteosid.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deleteosid.php3?osid=$osidx"
     else
39
     echo "*** No os id testosid3! ***"
Russ Fish's avatar
Russ Fish committed
40
     endif
41 42 43 44 45 46
    set usridx=`echo "select uid_idx from users where uid='testusr3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    usridx = $usridx"
     if ( "$usridx" != "" ) then
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deletepubkey.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deletepubkey.php3?key=1&user=$usridx"
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O freezeuser.php3.html --post-data "confirmed=Confirm&confirmed_twice=Confirm" "https://myboss.vulnelab.testbed.emulab.net/freezeuser.php3?user=$usridx&action=freeze"
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deleteuser.php3.html --post-data "confirmed=Confirm&confirmed_twice=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deleteuser.php3?user=$usridx&target_project=testproj3"
     else
47
     echo "*** No user testusr3! ***"
48
     endif
49
    echo  "delete from deleted_users where uid='testusr3'"| ssh $MYBOSS mysql tbdb
50
    echo  "delete from users where uid='testusr3' and status='archived'"| ssh $MYBOSS mysql tbdb
51 52
    set grpidx=`echo "select gid_idx from groups where gid='testgroup3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    grpidx = $grpidx"
     if ( "$grpidx" != "" ) then
53
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deletegroup.php3.html --post-data "confirmed=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deletegroup.php3?gid=testgroup3&pid=testproj3"
54
     else
55
     echo "*** No group testgroup3! ***"
56 57 58
     endif
    set projidx=`echo "select pid_idx from projects where pid='testproj3'"| ssh $MYBOSS mysql tbdb | tail +2`; echo "    projidx = $projidx"
     if ( "$projidx" != "" ) then
59
    echo  "delete from experiments where pid = 'testproj3' and eid like'T%-%'"| ssh $MYBOSS mysql tbdb
60 61
wget -S -k --keep-session-cookies --no-check-certificate --load-cookies cookies.txt -O deleteproject.php3.html --post-data "confirmed=Confirm&confirmed_twice=Confirm" "https://myboss.vulnelab.testbed.emulab.net/deleteproject.php3?pid=testproj3"
     else
62
     echo "*** No project testproj3! ***"
63
     endif
64
    echo  "delete from knowledge_base_entries where xref_tag like'test_tag%'"| ssh $MYBOSS mysql tbdb
65
    echo  "delete from users where uid='testusr3'"| ssh $MYBOSS mysql tbdb
Russ Fish's avatar
Russ Fish committed
66
    echo  "delete from group_membership where uid='testusr3'"| ssh $MYBOSS mysql tbdb
67 68
     ssh $MYBOSS sudo pw userdel -n testusr3
     echo Done.