Connecthon test is nfs testsuite which can run on both BSD and System V based systems
>From 22b8d2cf47e33b11296614f3d8daf2c351af63f9 Mon Sep 17 00:00:00 2001 From: pradeep <[email protected]> Date: Thu, 21 Jul 2011 11:11:00 +0530 Subject: [PATCH] [Autotest][Patch]: connecthon test wrapper Signed-off-by: Pradeep K Surisetty<[email protected]> Signed-off-by: Poornima Nayak<[email protected]> new file: client/tests/connecthon/connecthon.py new file: client/tests/connecthon/control --- client/tests/connecthon/connecthon.py | 65 +++++++++++++++++++++++++++++++++ client/tests/connecthon/control | 26 +++++++++++++ 2 files changed, 91 insertions(+), 0 deletions(-) create mode 100755 client/tests/connecthon/connecthon.py create mode 100755 client/tests/connecthon/control diff --git a/client/tests/connecthon/connecthon.py b/client/tests/connecthon/connecthon.py new file mode 100755 index 0000000..1d67dd4 --- /dev/null +++ b/client/tests/connecthon/connecthon.py @@ -0,0 +1,65 @@ +import os, shutil, glob, logging +from autotest_lib.client.bin import test, utils +from autotest_lib.client.common_lib import error + +class connecthon(test.test): + """ + Connecthon test is nfs testsuite which can run on + both BSD and System V based systems. The tests.init file + has to be modified based on the OS in which this test is run. + The tar file in this dir has init file which works for Linux + platform. As well as it has some minor fixes for the testsuit + + @author Poornima.Nayak([email protected])(original code) + """ + + version=1 + def initialize(self): + """ + Sets the overall failure counter for the test. + """ + self.nfail = 0 + + def run_once(self, tarball = None, testdir = None, args = '', iteration=1): + """ + Runs the test, with the appropriate control file. + """ + # Report the parameters we've received and write them as keyvals + logging.debug("Test parameters: %s %s %s"%(iteration, args,testdir)) + + if (not os.path.exists('cthon04')): + if not tarball: + tarball = 'cthon04.tgz' + + connecthon_tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) + logging.info("connecthon tarball is %s", connecthon_tarball) + utils.extract_tarball_to_dir(connecthon_tarball, self.srcdir) + + os.chdir(self.srcdir) + utils.system('make clean') + utils.system('make') + else: + os.chdir(self.srcdir) + + if not testdir: + testdir = self.tmpdir + + try: + if args == '': + #run basic test + args="-b -t" + + self.results = utils.system_output('./runtests -N %s %s %s' %(iteration,args,testdir)) + except Exception, e: + self.nfail += 1 + logging.error("Test failed: %s", e) + + + def cleanup(self): + """ + Cleans up source directory and raises on failure. + """ + if os.path.isdir(self.srcdir): + shutil.rmtree(self.srcdir) + if self.nfail != 0: + raise error.TestFail('Connecthon test suite failed.') diff --git a/client/tests/connecthon/control b/client/tests/connecthon/control new file mode 100755 index 0000000..f468466 --- /dev/null +++ b/client/tests/connecthon/control @@ -0,0 +1,26 @@ +AUTHOR = "Poornima Nayak <[email protected]" +NAME = "connecthon" +TEST_CATEGORY = "NFS FVT" +TEST_CLASS = "General" +TEST_TYPE = "client" +TIME = 'MEDIUM' +DOC = ''' +Test for testing nfs mounted path. + +More information about connecthon can be found at +http://www.connectathon.org/nfstests.html +''' + +import datetime +now = datetime.datetime.now() +#iter_range = [10, 100, 1000, 10000] +iter_range = [1] +#tests = ['-b -t', '-g -t', '-g -f', '-s -t', '-s -f', '-l -f', '-l -t'] +tests = ['-s -t'] +tag_ver=0 +for test in tests: + for j in iter_range: + dir = '/mnt/test'+now.strftime("%Y-%m-%d%H:%M") + job.run_test('connecthon', tarball=None, testdir=dir, args=test, iteration=j, tag=("itera-%s-test-%s" %(j, tag_ver))) + tag_ver = tag_ver + 1 + -- 1.7.0.4 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
