From e7d3a05134c35d826c3ef23783063a413fd890e8 Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Wed, 6 Oct 2010 15:39:21 -0700 Subject: [PATCH] accidental commit --- test.sh | 63 ------------------------------------------- test/addhosts.sh | 13 --------- test/admincookie.txt | 5 ---- test/cleanup.sh | 34 ----------------------- test/createlogin.sh | 5 ---- test/hosts.properties | 1 - test/setupzone.sh | 25 ----------------- test/test.sh | 5 ---- 8 files changed, 151 deletions(-) delete mode 100644 test.sh delete mode 100755 test/addhosts.sh delete mode 100644 test/admincookie.txt delete mode 100755 test/cleanup.sh delete mode 100755 test/createlogin.sh delete mode 100644 test/hosts.properties delete mode 100755 test/setupzone.sh delete mode 100755 test/test.sh diff --git a/test.sh b/test.sh deleted file mode 100644 index 3ebe9129a05..00000000000 --- a/test.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -MGMT_SERVER=$MGMT_SERVER - -#login -curl -c admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=login&username=admin&password=password&response=json" - -#delete service offerings -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteServiceOffering&id=1&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteServiceOffering&id=2&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteServiceOffering&id=3&response=json" - -#delete service offerings -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteDiskOffering&id=1&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteDiskOffering&id=2&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=deleteDiskOffering&id=3&response=json" - -#create service offerings -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createServiceOffering&cpuNumber=2&cpuSpeed=2400&memory=2400&displayText=Memcached%20Node&name=Memcached%20Node&storageType=local&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createServiceOffering&cpuNumber=2&cpuSpeed=2400&memory=2400&displayText=Web%20Node&name=Web%20Node&storageType=local&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createServiceOffering&cpuNumber=2&cpuSpeed=2400&memory=2400&displayText=Database%20Node&name=Database%20Node&storageType=local&response=json" - -#create disk offerings -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createDiskOffering&diskSize=20&displayText=Small%20Size&name=Volume%20#1&isMirrored=false&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createDiskOffering&diskSize=40&displayText=Volume%20Medium%20Size&name=Volume%20#2&isMirrored=false&response=json" -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createDiskOffering&diskSize=80&displayText=Volume%20Large%20Size&name=Volume%20#3&isMirrored=false&response=json" - -#add secondary storage -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=addSecondaryStorage&zoneId=1&url=nfs%3A//192.168.151.16/export/secondary-storage&response=json" - -#register template -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=registerTemplate&displayText=Rightscale%20%ami-ccb35ea5&format=VHD&isPublic=true&name=Rightscale%20ami-ccb35ea5&osTypeId=11&passwordEnabled=false&url=http%3A//nfs1.lab.vmops.com/templates/ami-ccb35ea5/ami-ccb35ea5.vhd.bz2&response=json" - -#add primary storage -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createStoragePool&zoneId=1&podId=1&url=nfs%3A//192.168.151.16/export/primary-storage&response=json" - -#add hosts here - -#check if templates are ready (DomR and Rightscale AMI) -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=listTemplates&isReady=true&showAll=true&response=json" - -#add user -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createUser&username=tester&email=tester&firstname=tester&accounttype=0&password=&lastname=tester&response=json" - -#login user -curl -c usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=login&username=tester&password=tester&response=json" - -#create VMs -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=deployVirtualMachine&zoneId=1&serviceofferingId=4&diskOfferingId=4&templateId=201&displayName=Farmville2&group=Farmville%20Group&response=json" - -#get IP (n times) -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=associateIpAddress&zoneId=1&response=json" - -#list IP addresses -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=listPublicIpAddresses&zoneId=1&response=json" - -#create security group and add rule -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=createSecurityGroup&name=ssh1&description=ssh1&response=json" -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=createNetworkRule&privateport=22&protocol=TCP&publicport=22&securitygroupid=1&response=json" -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=queryAsyncJobResult&jobId=8&response=json" - -#assign security group -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=assignSecurityGroup&groupids=1&publicip=172.24.0.102&virtualmachineid=5&response=json" | awk '{print $(NF-1)}' -curl -b usercookie.txt -sS "http://$MGMT_SERVER/client/api?command=queryAsyncJobResult&jobId=8&response=json" diff --git a/test/addhosts.sh b/test/addhosts.sh deleted file mode 100755 index bda305d7db0..00000000000 --- a/test/addhosts.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -MGMT_SERVER=localhost -PASSWORD=password -USERNAME=root -sessionkey=$1 - -zoneId=5 -podId=5 -ip=192.168.140.11 -cluster=CV -err=$(curl -sS "http://${MGMT_SERVER}:8096/?command=addHost&zoneId=$zoneId&cluster=$clustername&podId=$podId&url=http://$ip&username=$USERNAME&password=$PASSWORD&sessionkey=$sessionkey&response=json") - diff --git a/test/admincookie.txt b/test/admincookie.txt deleted file mode 100644 index a9c17affde9..00000000000 --- a/test/admincookie.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Netscape HTTP Cookie File -# http://curl.haxx.se/rfc/cookie_spec.html -# This file was generated by libcurl! Edit at your own risk. - -localhost FALSE /client FALSE 0 JSESSIONID 71E3FBC27B8B647B09FFAABB458D1E20 diff --git a/test/cleanup.sh b/test/cleanup.sh deleted file mode 100755 index 9e50d70990d..00000000000 --- a/test/cleanup.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -. /etc/rc.d/init.d/functions -source $(dirname $0)/hosts.properties - -set -x - - - -cleanup_xen_host(){ -ssh root@$1 "for vm in \`xe vm-list | grep name-label | grep -v Control | awk '{print \$4}'\`; do uuid=\`xe vm-list name-label=\$vm | grep uuid | awk '{print \$5}'\`; echo \$uuid; xe vm-shutdown --force uuid=\$uuid; xe vm-destroy uuid=\$uuid; done" -ssh root@$1 "for vlan in \`xe vlan-list | grep uuid | awk '{print \$5}'\`; do echo \$vlan; xe vlan-destroy uuid=\$vlan; done" -ssh root@$1 "for vlan in \`xe network-list | grep name-label | grep VLAN| awk '{print \$4}'\`; do echo \$vlan; uuid=\`xe network-list name-label=\$vlan | grep uuid | awk '{print \$5}'\`; xe network-destroy uuid=\$uuid; done" -ssh root@$1 "for sr in \`xe sr-list type=nfs name-description=storage | grep uuid | awk '{print \$5}'\`; do pbd=\`xe pbd-list sr-uuid=\$sr | grep ^uuid | awk '{ print \$5}'\` ; echo \$pbd; xe pbd-unplug uuid=\$pbd; xe pbd-destroy uuid=\$pbd; xe sr-forget uuid=\$sr; done" -ssh root@$1 "for sr in \`xe sr-list type=nfs | grep uuid | awk '{print \$5}'\`; do pbd=\`xe pbd-list sr-uuid=\$sr | grep ^uuid | awk '{ print \$5}'\` ; echo \$pbd; xe pbd-unplug uuid=\$pbd; xe pbd-destroy uuid=\$pbd; xe sr-forget uuid=\$sr; done" -ssh root@$1 "sr=\`xe sr-list type=lvm | grep uuid | awk '{print \$5}'\`; for vdi in \`xe vdi-list sr-uuid=\$sr | grep ^uuid | awk '{ print \$5}'\` ; do echo \$vdi; xe vdi-destroy uuid=\$vdi; done" -} - -cleanup_primary() { - ssh root@nfs1.lab.vmops.com 'rm -vf /export/home/chiradeep/primary/*.vhd' -} - -dir=$(dirname "$0") -if [ -f $dir/../deploy.properties ]; then - . "$dir/../deploy.properties" -fi - -#Kill vms and delete vlans on all computing hosts -for i in $COMPUTE -do - cleanup_xen_host $i -done - -cleanup_primary diff --git a/test/createlogin.sh b/test/createlogin.sh deleted file mode 100755 index 603a306200c..00000000000 --- a/test/createlogin.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -sessionkey=$(curl -c admincookie.txt -sS "http://localhost:8080/client/api?command=login&username=admin&password=5f4dcc3b5aa765d61d8327deb882cf99&response=json" | awk -F "," '{print $13}' | awk -F":" '{print $2}' | tr -d '[:space:]' | tr -d '"') - -echo $sessionkey diff --git a/test/hosts.properties b/test/hosts.properties deleted file mode 100644 index 8bf9d859596..00000000000 --- a/test/hosts.properties +++ /dev/null @@ -1 +0,0 @@ -COMPUTE=192.168.140.11 diff --git a/test/setupzone.sh b/test/setupzone.sh deleted file mode 100755 index d7c9c19fd34..00000000000 --- a/test/setupzone.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -MGMT_SERVER=localhost:8080 - -set -x -sessionkey=$1 -#create zone -# curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=createZone&name=$ZONENAME&dns1=$EXTDNS1&internaldns1=8.8.8.8&guestcidraddress=10.1.1.1/24&vlan=1000-1100&response=json" -echo -#update zone -#curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=updateZone&id=1&name=$ZONENAME&DNS1=$EXTDNS1&internaldns1=$INTDNS1&guestcidraddress=10.1.1.1/24&vlan=1000-1100&response=json" -echo - -#add pods -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=updatePod&id=5&name=CV&gateway=192.168.140.1&cidr=192.168.140.0%2F24&startip=192.168.140.150&endip=192.168.140.155&sessionkey=$sessionkey&response=json" -echo -#curl -b admincookie.txt -sS "http://localhost:8080/client/api?command=createPod&name=POD2&zoneid=1&gateway=192.168.203.1&cidr=192.168.203.0%2F24&startip=192.168.203.65&endip=192.168.203.72&response=json" -echo - -#add secondary storage -curl -b admincookie.txt -sS "http://$MGMT_SERVER/client/api?command=addSecondaryStorage&zoneId=5&url=nfs%3A//nfs1.lab.vmops.com/export/home/chiradeep/secondary/&sessionkey=$sessionkey&response=json" -echo - -#register template - -#curl -b admincookie.txt -sS "http://localhost:8080/client/api?command=registerTemplate&displayText=Rightscale%20%ami-ccb35ea5&format=VHD&isPublic=true&name=Rightscale%20ami-ccb35ea5&osTypeId=11&passwordEnabled=false&url=http%3A//192.168.90.243/templates/zynga/ami-ccb35ea5.vhd.bz2&displayText=ZyngaRSTemplate&zoneId=1&ostypeid=12&sessionkey=$sessionkey&response=json" diff --git a/test/test.sh b/test/test.sh deleted file mode 100755 index 830dd5634b6..00000000000 --- a/test/test.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -sessionkey=$($(dirname $0)/createlogin.sh) -$(dirname $0)/setupzone.sh $sessionkey -$(dirname $0)/addhosts.sh $sessionkey