def startRun(self, guest): # Get a working directory on the guest. self.workdir = guest.xmlrpcTempDir() self.guest = guest # Unpack the test binaries. if self.amd64: testname = "burnintest64" eargs = "-p" else: testname = "burnintest" eargs = "" if not xenrt.checkTarball("%s.tgz" % (testname)): xenrt.TEC().skip("Test tarball not found") return None guest.xmlrpcUnpackTarball( "%s/%s.tgz" % (xenrt.TEC().lookup("TEST_TARBALL_BASE"), testname), self.workdir) # Run the benchmark. ref = guest.xmlrpcStart("cd %s\\%s\n" "bit.exe -C %s\\%s\\%s -R -x %s" % (self.workdir, testname, self.workdir, testname, self.bitcfg, eargs)) time.sleep(60) if not "bit.exe" in guest.xmlrpcPS(): raise xenrt.XRTFailure("Burnintest failed to start.") return ref
def install(self, startOnBoot=False): if self.skip: xenrt.TEC().logverbose("Skipping workload %s." % (self.name)) return xenrt.TEC().logverbose("Installing workload %s." % (self.name)) self.workdir = self.guest.xmlrpcTempDir() if self.tarball: if not xenrt.checkTarball(self.tarball): self.skip = True xenrt.TEC().logverbose("Skipping workload %s due to missing " "tarball." % (self.name)) return self.guest.xmlrpcUnpackTarball( "%s/%s" % (xenrt.TEC().lookup("TEST_TARBALL_BASE"), (self.tarball)), self.workdir) if startOnBoot: self.startOnBoot = True # Write command line to startup folder data = "@echo off\n%s\n" % (string.replace(self.cmdline, "%s", self.workdir)) startupPath = self.guest.xmlrpcGetEnvVar( "ALLUSERSPROFILE") + "\\start menu\\programs\\startup" if not self.guest.xmlrpcFileExists(startupPath): raise xenrt.XRTFailure( "Start up path for guest is invalid: %s" % startupPath) self.guest.xmlrpcWriteFile( "%s\\XRT_%s_%s.bat" % (startupPath, self.name, self.workdir.split("\\")[-1]), data)
def runViaDaemon(self, remote, arglist): if not xenrt.checkTarball("perftest.tgz"): xenrt.TEC().skip("Test tarball not found") return workdir = remote.xmlrpcTempDir() xenrt.TEC().logverbose("Using temporary directory: %s" % (workdir)) remote.xmlrpcUnpackTarball("%s/perftest.tgz" % (xenrt.TEC().lookup("TEST_TARBALL_BASE")), workdir) try: remote.xmlrpcRemoveFile("c:\\results.csv") except: pass remote.xmlrpcExec("%s\\perftest\\pt.exe /s %s\\perftest\\script.txt /i" % (workdir, workdir), timeout=600) # Process results. data = str(remote.xmlrpcReadFile("c:\\results.csv")).strip() headers = data.split("\r\n")[0].split(",")[1:] values = data.split("\r\n")[1].split(",")[1:] headers.remove('') values.remove('') for i in range(len(headers)): self.tec.value(headers[i], values[i])
def startRun(self, guest): # Get a working directory on the guest. self.workdir = guest.xmlrpcTempDir() self.guest = guest # Unpack the test binaries. if self.amd64: testname = "burnintest64" eargs = "-p" else: testname = "burnintest" eargs = "" if not xenrt.checkTarball("%s.tgz" % (testname)): xenrt.TEC().skip("Test tarball not found") return None guest.xmlrpcUnpackTarball("%s/%s.tgz" % (xenrt.TEC().lookup("TEST_TARBALL_BASE"), testname), self.workdir) # Run the benchmark. ref = guest.xmlrpcStart("cd %s\\%s\n" "bit.exe -C %s\\%s\\%s -R -x %s" % (self.workdir, testname, self.workdir, testname, self.bitcfg, eargs)) time.sleep(60) if not "bit.exe" in guest.xmlrpcPS(): raise xenrt.XRTFailure("Burnintest failed to start.") return ref
def install(self, startOnBoot=False): if self.skip: xenrt.TEC().logverbose("Skipping workload %s." % (self.name)) return xenrt.TEC().logverbose("Installing workload %s." % (self.name)) self.workdir = self.guest.execguest( "mktemp -d /tmp/workXXXXXX").strip() if self.tarball: if not xenrt.checkTarball(self.tarball): self.skip = True xenrt.TEC().logverbose("Skipping workload %s due to missing " "tarball." % (self.name)) return self.guest.execguest("wget '%s/%s' -O - | tar -zx -C %s" % (xenrt.TEC().lookup("TEST_TARBALL_BASE"), self.tarball, self.workdir)) self.workdir = "%s/%s" % (self.workdir, self.tarball.split(".")[0]) if startOnBoot: self.startOnBoot = True # Write command line into /etc/rc.local self.guest.runOnStartup( string.replace(self.cmdline, "%s", self.workdir))