Permalink
Browse files

adding a new test

  • Loading branch information...
1 parent 53a2d6e commit b774b461c108f2974211a5d52e4f3e9fe78191bc BuzzTroll committed Aug 27, 2010
Showing with 71 additions and 31 deletions.
  1. +63 −0 tests/cc-xfer-report-test.py
  2. +1 −1 virga/bin/virga.sh
  3. +2 −3 virga/etc/virga.ini
  4. +5 −3 virga/pyvirga/__init__.py
  5. BIN virga/req.db
  6. +0 −3 virga/run-client.sh
  7. +0 −21 virga/run-em.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+
+import pexpect
+import sys
+import os
+
+cc_home=os.environ['CLOUD_CLIENT_HOME']
+logfile = sys.stdout
+
+src_file = "/etc/group"
+sfa = src_file.split("/")
+image_name = sfa[len(sfa) - 1]
+size = os.path.getsize(src_file)
+cmd = "%s/bin/cloud-client.sh --transfer --sourcefile %s" % (cc_home, src_file)
+(x, rc)=pexpect.run(cmd, withexitstatus=1)
+
+cmd = "%s/bin/cloud-client.sh --list" % (cc_home)
+child = pexpect.spawn (cmd, timeout=30, maxread=20000, logfile=logfile)
+rc = child.expect (image_name)
+if rc != 0:
+ print "%s not found in the list" % (image_name)
+ sys.exit(1)
+
+# the rest of this line should have Read/write.
+line = child.readline().replace("'", "").strip()
+if line.find('Read/write') < 0:
+ print "%s is not listed as Read/write" % (image_name)
+ sys.exit(1)
+
+line = child.readline()
+token = "Size: "
+ndx = line.find(token)
+if ndx < 0:
+ print "%s not found in line %s" % (token, line)
+ sys.exit(1)
+line = line[ndx + len(token):]
+ndx = line.find(" ")
+if ndx < 0:
+ print "%s not found in line %s" % (token, line)
+ sys.exit(1)
+line = line[0:ndx].strip()
+
+show_size = int(line)
+
+if show_size != size:
+ print "%s not found in line %s" % (token, line)
+ sys.exit(1)
+
+print "sizes match! %d" % (show_size)
+
+rc = child.expect(pexpect.EOF)
+if rc != 0:
+ print "run"
+ sys.exit(1)
+
+cmd = "%s/bin/cloud-client.sh --delete --name %s" % (cc_home, image_name)
+print cmd
+(x, rc)=pexpect.run(cmd, withexitstatus=1)
+print x
+if rc != 0:
+ print "failed to delete"
+ sys.exit(1)
+sys.exit(0)
View
@@ -9,5 +9,5 @@ else
export PYTHONPATH=$pypath:${PYTHONPATH}
fi
-export NIMBUS_HOME=$pypath
+export VIRGA_HOME=$pypath
exec python ./pyvirga/virga.py "${@}"
View
@@ -2,8 +2,7 @@
password=nimbus
[log]
-file=/home/bresnaha/virga.log
+file=@VIRGA_HOME@/log/virga.log
level=debug
[db]
-file=/home/bresnaha/Dev/Nimbus/nimbus/virga/req.db
-
+file=@VIRGA_HOME@/etc/req.db
@@ -30,9 +30,11 @@ def __init__(self):
self.set_defaults()
if 'VIRGA_HOME' not in os.environ:
emsg = "the env VIRGA_HOME must be set"
+ self.virga_home = os.path.expanduser("virga")
log(logging.WARNING, emsg)
else:
- ini_file = os.path.join(os.environ['VIRGA_HOME'], "etc/virga.ini")
+ self.virga_home = os.environ['VIRGA_HOME']
+ ini_file = os.path.join(self.virga_home, "etc/virga.ini")
try:
self.load_settings(ini_file)
@@ -58,7 +60,7 @@ def load_settings(self, ini_file):
s = SafeConfigParser()
s.readfp(open(ini_file, "r"))
self.pw = s.get("security", "password")
- self.logfile = s.get("log", "file")
+ self.logfile = s.get("log", "file").replace("@VIRGA@", self.virga_home)
self.host = s.get("host", "host")
self.port = s.getint("port", "port")
try:
@@ -67,7 +69,7 @@ def load_settings(self, ini_file):
except Exception, ex:
pass
try:
- self.dbfile = s.get("db", "file")
+ self.dbfile = s.get("db", "file").replace("@VIRGA@", self.virga_home)
except:
pass
View
Binary file not shown.
View
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-cat $1 | ./bin/client.sh $2
View
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-sz="2 4 8 16 32 64"
-
-echo "cleaning up old stuff"
-pdsh -R ssh -g murder64 rm /home/nimbus/new.test
-tm_file=$1
-for s in $sz
-do
- #echo "making header"
- #pdsh -R ssh -g murder$s /sbin/ifconfig | grep 'inet addr:172' | sed 's/.*inet addr://' | sed 's/Bcast:.*//' | awk '{ print $1 ":2893/home/nimbus/new.test"}' > header$s
-
- echo "running virga"
- /usr/bin/time --append -o $tm_file --format "v2 $s %e" ./run-client.sh header$s /home/nimbus/FILE
- echo "check sum"
- pdsh -R ssh -g murder$s md5sum /home/nimbus/new.test
- pdsh -R ssh -g murder$s ls -l /home/nimbus/new.test
- echo "cleaning up"
- pdsh -R ssh -g murder$s rm /home/nimbus/new.test
- cat $tm_file
-done

0 comments on commit b774b46

Please sign in to comment.