minor updates
Tony Mack [Thu, 17 Jul 2008 21:36:06 +0000 (21:36 +0000)]
qaapi/qa/tests/add_test_data.py
qaapi/qa/tests/boot_node.py
qaapi/qa/tests/node_run_tests.py

index 57c30cd..151c8a0 100644 (file)
@@ -23,7 +23,8 @@ class add_test_data(Test):
                                  object['plcs'] == None   
        
        sitelist, nodelist, slicelist, personlist, nodegrouplist = [], [], [], [], []
-       if isinstance(self.config.sites.values, dict):
+       
+       if isinstance(self.config.sites, dict):
            sitelist = filter(this_plc, self.config.sites.values())     
        if isinstance(self.config.nodes, dict):
            nodelist = filter(this_plc, self.config.nodes.values())
@@ -33,7 +34,7 @@ class add_test_data(Test):
            personlist = filter(this_plc, self.config.persons.values()) 
        if isinstance(self.config.nodegroups, dict): 
            nodegrouplist = filter(this_plc, self.config.nodegroups.values())
-       
+
        # Add Test site
        for site in sitelist:
            sites = api.GetSites(auth, [site['login_base']])
index ac26982..9567a29 100644 (file)
@@ -91,12 +91,16 @@ class boot_node(Test):
        bootimage_filename = "%(hostname)s-bootcd.iso" % locals()
        diskimage_filename = "%(hostname)s-hda.img" % locals() 
        bootimage = "%(homedir)s/%(bootimage_filename)s" % locals()
-       diskimage = "%(homedir)s/%(diskimage_filename)s" % locals() 
-       diskimage_path = "/%(path)s/%(diskimage_filename)s" % locals() 
+       diskimage = "%(homedir)s/%(diskimage_filename)s" % locals()
+       print bootimage
+       print diskimage 
+       diskimage_path = "/%(path)s/%(diskimage)s" % locals() 
         bootimage_tmppath = "%(tmpdir)s/%(bootimage_filename)s" % locals()
-       bootimage_path = "%(path)s/%(bootimage_filename)s" % locals()
+       bootimage_path = "/%(path)s/%(bootimage)s" % locals()
        remote_bootimage_path = "%(homedir)s/%(bootimage_filename)s" % locals() 
-        
+       print bootimage_path
+       print diskimage_path
+       print remote_bootimage_path 
        # wait up to 30 minutes for a node to boot and install itself correctly
         self.hostname = hostname
         self.totaltime = 60*60*wait
@@ -126,8 +130,8 @@ class boot_node(Test):
        node.scp_to_host(bootimage_tmppath, "%(remote_bootimage_path)s" % locals())
 
        # If node is vm (qemu) try installing kqemu
-       node.host_commands("yum -y install kqemu", False)
-       node.host_commands("modprobe kqemu")
+       #node.host_commands("yum -y install kqemu", False)
+       #node.host_commands("modprobe kqemu", False)
        
        # Create a temporary disk image if it doesnt already exist or we are reinstalling
        img_check_cmd =  "ls -ld %(diskimage)s" % locals()
@@ -175,7 +179,7 @@ class boot_node(Test):
        bootcmd = bootcmd + " 2>&1 >> %s " % (node.logfile.filename)
         
        # kill any old qemu processes for this node
-       pid_cmd = "ps -elfy | grep qemu | grep %(hostname)s | awk '{print$3}'" % locals()
+       pid_cmd = "ps -elfy | grep qemu | grep -v grep | grep %(hostname)s | awk '{print$3}'" % locals()
        (status, output) = node.host_commands(pid_cmd)
        pids = " ".join(output.split("\n")).strip() 
        if pids:
index 9738b40..faad6c2 100755 (executable)
@@ -33,7 +33,7 @@ class node_run_tests(Test):
                raise Exception, "Invalid test(s) %s. File(s) not found in %s" % \
                                (" ".join(list(invalid_tests)), node_tests_path)
                
-       result = {}
+       results = {}
        if self.config.verbose:
            utils.header("Running %(test)s test on %(hostname)s" % locals(), logfile = self.logfile)
        script = self.config.get_node_test(test)
@@ -42,17 +42,17 @@ class node_run_tests(Test):
        if script['pre']: exe_pre = script['exe_pre']
        if script['args']: exe_script = "%s %s" % (script['name'], script['args'])
        if script['post']: exe_post = script['exe_post']
+
        for command in [exe_pre, exe_script, exe_post]:
             if command:
-               command = "cd %(tests_dir)s/%(archive_dir)s && ./%(command)s" % locals()
+               command = "cd %(tests_dir)s/node/  && ./%(command)s" % locals()
                print >> node.logfile,  command
                print >> self.logfile, command
   
                 # Execute script on node
                (stdout, stderr) = node.popen(command, False)
                print >> node.logfile, "".join(stdout)   
-               print >> logfile, "".join(stdout) 
+               print >> self.logfile, "".join(stdout) 
                if self.config.verbose:
                    utils.header(stdout, logfile = self.config.logfile)
                results[test] = (stdout, stderr)