class SanityTC(CustomTestCase): """Sanity test""" def setUp(self): self.phase_list.append( [self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() fs_path = self.args[0].test_path if not os.path.isdir(fs_path): raise NoSuchDir(fs_path) self.test_path = os.path.join( fs_path, "sanity_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) self.smb_server = self.args[0].smb_server self.smb_user = self.args[0].smb_user self.smb_pwd = self.args[0].smb_pwd self.case_filter = self.args[0].case_filter self.expect_failures = [] # ==== smbtorture ==== @unittest.skipUnless(posix_ready(), "Not supported platform") def test_smbtorture(self): """Samba torture test suite""" from storagetest.pkgs.smb.smbtorture import SMBTorture smb = SMBTorture(self.test_path, self.smb_server, self.smb_user, self.smb_pwd, self.case_filter, self.expect_failures) logger.info(smb.__doc__) self.assertTrue(smb.sanity())
class SanityTC(CustomTestCase): """Sanity test on a mount point or path""" def setUp(self): self.phase_list.append([self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() fs_path = self.args[0].test_path if not os.path.isdir(fs_path): raise NoSuchDir(fs_path) self.test_path = os.path.join(fs_path, "sanity_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) # ==== LTP ==== @unittest.skipUnless(posix_ready(), "Not supported platform") def test_01(self): """Test DESC: TODO""" logger.info(self.test_01.__doc__) self.assertTrue(True)
class StressTC(CustomTestCase): """Stress test on a mount point or path""" def setUp(self): self.phase_list.append( [self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() self.fs_path = self.args[0].test_path if not os.path.isdir(self.fs_path): raise NoSuchDir(self.fs_path) self.test_path = os.path.join( self.fs_path, "stress_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) # ==== LTP ==== @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(attr_ready(), "attr not installed!") def test_acl(self): """Test ACL and Extend Attribute on Linux system""" from storagetest.pkgs.ltp.acl import AclXattr acl = AclXattr(self.test_path) logger.info(acl.__doc__) self.assertTrue(acl.stress()) def test_create_files(self): """Creates files of specified size""" from storagetest.pkgs.ltp.create import CreateDataFile cdf = CreateDataFile(self.test_path) logger.info(cdf.__doc__) self.assertTrue(cdf.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_doio(self): """base rw test: LTP doio & iogen; growfiles""" from storagetest.pkgs.ltp.doio import DoIO dio = DoIO(self.test_path) logger.info(dio.__doc__) self.assertTrue(dio.rwtest()) self.assertTrue(dio.growfiles()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fs_di(self): """Test FileSystem Data Integrity""" from storagetest.pkgs.ltp.fs_di import FSDataIntegrity fdi = FSDataIntegrity(self.test_path) logger.info(fdi.__doc__) self.assertTrue(fdi.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fsstress(self): """filesystem stress with LTP tool fsstress""" from storagetest.pkgs.ltp.fsstress import FSStress fs_stress = FSStress(self.test_path) logger.info(fs_stress.__doc__) fs_stress.stress() @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_locktests(self): """Test fcntl locking functions""" from storagetest.pkgs.ltp.locktests import LockTest lct = LockTest(self.test_path) logger.info(lct.__doc__) self.assertTrue(lct.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_readall(self): """Perform a small read on every file in a directory tree.""" from storagetest.pkgs.ltp.read import ReadAll readall = ReadAll(self.fs_path) logger.info(readall.__doc__) self.assertTrue(readall.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_stream(self): """LTP file stream test""" from storagetest.pkgs.ltp.stream import StreamTest stream = StreamTest(self.test_path) logger.info(stream.__doc__) self.assertTrue(stream.stress()) # ==== PTS ==== @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_aio(self): """a-synchronous I/O benchmark""" from storagetest.pkgs.pts.aio import AioStress aio = AioStress(self.test_path) logger.info(aio.__doc__) self.assertTrue(aio.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_compilebench(self): """Simulating disk IO common in creating, compiling, patching, stating and reading kernel trees.""" from storagetest.pkgs.pts.compilebench import CompileBench cb = CompileBench(self.test_path) logger.info(cb.__doc__) self.assertTrue(cb.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_dbench(self): """A load tester for various protocols such as iSCSI, NFS, SCSI, SMB.""" from storagetest.pkgs.pts.dbench import Dbench db = Dbench(self.test_path) logger.info(db.__doc__) self.assertTrue(db.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(fio_ready(), "fio not installed!") def test_fio(self): """FIO: Flexible I/O tester.""" from storagetest.pkgs.pts.fio import FIO fio = FIO(self.test_path) logger.info(fio.__doc__) self.assertTrue(fio.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fs_mark(self): """The fs_mark benchmark tests synchronous write workloads""" from storagetest.pkgs.pts.fs_mark import FSMark fm = FSMark(self.test_path) logger.info(fm.__doc__) self.assertTrue(fm.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_iozone(self): """A benchmark tests for generates and measures a variety of file operations.""" from storagetest.pkgs.pts.iozone import IOzone ioz = IOzone(self.test_path) logger.info(ioz.__doc__) self.assertTrue(ioz.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_postmark(self): """Simulate small-file testing similar to the tasks endured by web and mail servers""" from storagetest.pkgs.pts.postmark import PostMark pm = PostMark(self.test_path) logger.info(pm.__doc__) self.assertTrue(pm.stress()) # ==== Tools/Private ==== @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(filebench_ready(), "filebench not installed!") def test_filebench(self): """File System Workload test""" from storagetest.pkgs.filebench import FileBench fb = FileBench(self.test_path) logger.info(fb.__doc__) self.assertTrue(fb.stress()) @unittest.skipUnless(posix_ready(), "Not supported platform!") @unittest.skipUnless(prove_ready(), "perl not installed!") def test_fstest(self): """Test FS function:chmod, chown, link, mkdir, mkfifo, open, rename, rmdir, symlink, truncate, unlink""" from storagetest.pkgs.fstest import FSTest fs_test = FSTest(self.test_path) logger.info(fs_test.__doc__) self.assertTrue(fs_test.stress()) def test_consistency(self): """Test the file consistency""" from storagetest.pkgs.fileops import Consistency cst = Consistency(self.test_path) logger.info(cst.__doc__) self.assertTrue(cst.stress()) def test_fileops(self): """Test the various of file operations""" from storagetest.pkgs.fileops import LocalFileOps fops = LocalFileOps(self.test_path) logger.info(fops.__doc__) self.assertTrue(fops.stress())
class SanityTC(CustomTestCase): """Sanity test on a mount point or path""" def setUp(self): self.phase_list.append( [self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() self.fs_path = self.args[0].test_path if not os.path.isdir(self.fs_path): raise NoSuchDir(self.fs_path) self.test_path = os.path.join( self.fs_path, "sanity_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) # ==== LTP ==== @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(attr_ready(), "attr not installed!") def test_acl(self): """Test ACL and Extend Attribute on Linux system""" from storagetest.pkgs.ltp.acl import AclXattr acl = AclXattr(self.test_path) logger.info(acl.__doc__) self.assertTrue(acl.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_doio(self): """base rw test: LTP doio & iogen""" from storagetest.pkgs.ltp.doio import DoIO dio = DoIO(self.test_path) logger.info(dio.__doc__) self.assertTrue(dio.iogen_doio()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fs_di(self): """Test FileSystem Data Integrity""" from storagetest.pkgs.ltp.fs_di import FSDataIntegrity fdi = FSDataIntegrity(self.test_path) logger.info(fdi.__doc__) self.assertTrue(fdi.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_locktests(self): """Test fcntl locking functions""" from storagetest.pkgs.ltp.locktests import LockTest lct = LockTest(self.test_path) logger.info(lct.__doc__) self.assertTrue(lct.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_readall(self): """Perform a small read on every file in a directory tree.""" from storagetest.pkgs.ltp.read import ReadAll readall = ReadAll(self.fs_path) logger.info(readall.__doc__) self.assertTrue(readall.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_stream(self): """LTP file stream test""" from storagetest.pkgs.ltp.stream import StreamTest stream = StreamTest(self.test_path) logger.info(stream.__doc__) self.assertTrue(stream.sanity()) # ==== PTS ==== @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_dbench(self): """A load tester for various protocols such as iSCSI, NFS, SCSI, SMB.""" from storagetest.pkgs.pts.dbench import Dbench db = Dbench(self.test_path) logger.info(db.__doc__) self.assertTrue(db.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(fio_ready(), "fio not installed!") def test_fio(self): """FIO: Flexible I/O tester.""" from storagetest.pkgs.pts.fio import FIO fio = FIO(self.test_path) logger.info(fio.__doc__) self.assertTrue(fio.sanity()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_postmark(self): """Simulate small-file testing similar to the tasks endured by web and mail servers""" from storagetest.pkgs.pts.postmark import PostMark pm = PostMark(self.test_path) logger.info(pm.__doc__) self.assertTrue(pm.sanity()) # ==== Tools/Private ==== @unittest.skipUnless(posix_ready(), "Not supported platform!") @unittest.skipUnless(prove_ready(), "perl not installed!") def test_fstest(self): """Test FS function:chmod, chown, link, mkdir, mkfifo, open, rename, rmdir, symlink, truncate, unlink""" from storagetest.pkgs.fstest import FSTest fs_test = FSTest(self.test_path) logger.info(fs_test.__doc__) self.assertTrue(fs_test.sanity()) def test_consistency(self): """Test the file consistency""" from storagetest.pkgs.fileops import Consistency cst = Consistency(self.test_path) logger.info(cst.__doc__) self.assertTrue(cst.sanity()) def test_fileops(self): """Test the various of file operations""" from storagetest.pkgs.fileops import LocalFileOps fops = LocalFileOps(self.test_path) logger.info(fops.__doc__) self.assertTrue(fops.sanity())
class LoadGenTC(CustomTestCase): """Generate data on a mount point or path""" def setUp(self): self.phase_list.append( [self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() fs_path = self.args[0].test_path self.dir_n = self.args[0].dir_number self.file_n = self.args[0].file_number self.file_size_range = self.args[0].file_size_range if not os.path.isdir(fs_path): raise NoSuchDir(fs_path) self.test_path = os.path.join( fs_path, "load_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) def test_empty_files(self): """Generate empty files by Consistency""" logger.info(self.test_empty_files.__doc__) from storagetest.pkgs.fileops import Consistency cst = Consistency(self.test_path) cst.verify() test_top_path = os.path.join(self.test_path, 'empty_files') for x in range(0, self.dir_n): test_path = os.path.join(test_top_path, 'dir_{0}'.format(x)) self.assertTrue(cst.create(test_path, self.file_n, 0)) def test_small_files(self): """Generate small files by Consistency""" logger.info(self.test_small_files.__doc__) from storagetest.pkgs.fileops import Consistency cst = Consistency(self.test_path) cst.verify() test_top_path = os.path.join(self.test_path, 'small_files') for x in range(0, self.dir_n): test_path = os.path.join(test_top_path, 'dir_{0}'.format(x)) f_size_min, f_size_max = utils.to_int_list(self.file_size_range) f_size = random.randint(f_size_min, f_size_max) self.assertTrue(cst.create(test_path, self.file_n, f_size)) def test_large_files(self): """Generate large files by LocalFileOps""" logger.info(self.test_large_files.__doc__) from storagetest.pkgs.fileops import LocalFileOps fops = LocalFileOps(self.test_path) test_top_path = os.path.join(self.test_path, 'large_files') for x in range(0, self.dir_n): dir_path = os.path.join(test_top_path, 'dir_{0}'.format(x)) utils.mkdir_path(dir_path) for n in range(0, self.file_n): file_path = os.path.join(dir_path, 'file-{0}.dat'.format(x)) f_size_min, f_size_max = utils.to_int_list( self.file_size_range) self.assertTrue( fops.create_large_size_file(file_path, f_size_max)) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_create_files(self): """Creates files of specified size""" logger.info(self.test_create_files.__doc__) from storagetest.pkgs.ltp.create import CreateDataFile cdf = CreateDataFile(self.test_path) cdf.verify() test_top_path = os.path.join(self.test_path, 'create_files') for x in range(0, self.dir_n): test_path = os.path.join(test_top_path, "dir_{}".format(x)) f_size_min, f_size_max = utils.to_int_list(self.file_size_range) f_size = random.randint(f_size_min, f_size_max) self.assertTrue(cdf.run(test_path, self.file_n, f_size)) @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(fio_ready(), "fio not installed!") def test_seq_files(self): """Generate sequential files of specified size by fio""" logger.info(self.test_empty_files.__doc__) from storagetest.pkgs.pts.fio import FIO for x in range(0, self.dir_n): f_size_min, f_size_max = utils.to_int_list(self.file_size_range) f_size = random.randint(f_size_min, f_size_max) fio = FIO( os.path.join(self.test_path, 'seq_files_dir_{0}'.format(x))) self.assertTrue(fio.seq_write(self.file_n, str(f_size))) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fsstress(self): """Generate sub dirs/files by fsstress""" logger.info(self.test_fsstress.__doc__) from storagetest.pkgs.ltp.fsstress import FSStress fs_stress = FSStress(self.test_path) fs_stress.sanity()
class BenchMarkTC(CustomTestCase): """BenchMark test on a mount point or path""" def setUp(self): self.phase_list.append( [self.id().split('.')[-1], "Start", '', self.shortDescription()]) self.start_time = datetime.now() self.print_phase() fs_path = self.args[0].test_path if not os.path.isdir(fs_path): raise NoSuchDir(fs_path) self.test_path = os.path.join( fs_path, "benchmark_{0}_{1}".format(self.str_time, self.tc_loop[self.id()])) utils.mkdir_path(self.test_path) # ==== PTS ==== @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_aio(self): """a-synchronous I/O benchmark""" from storagetest.pkgs.pts.aio import AioStress aio = AioStress(self.test_path) logger.info(aio.__doc__) self.assertTrue(aio.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_compilebench(self): """Simulating disk IO common in creating, compiling, patching, stating and reading kernel trees.""" from storagetest.pkgs.pts.compilebench import CompileBench cb = CompileBench(self.test_path) logger.info(cb.__doc__) self.assertTrue(cb.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_dbench(self): """A load tester for various protocols such as iSCSI, NFS, SCSI, SMB.""" from storagetest.pkgs.pts.dbench import Dbench db = Dbench(self.test_path) logger.info(db.__doc__) self.assertTrue(db.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform") @unittest.skipUnless(fio_ready(), "fio not installed!") def test_fio(self): """Flexible I/O tester""" from storagetest.pkgs.pts.fio import FIO fio = FIO(self.test_path) logger.info(fio.__doc__) self.assertTrue(fio.google_benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_fs_mark(self): """A benchmark tests for synchronous write workloads""" from storagetest.pkgs.pts.fs_mark import FSMark fm = FSMark(self.test_path) logger.info(fm.__doc__) self.assertTrue(fm.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_iozone(self): """A benchmark tests for generates and measures a variety of file operations.""" from storagetest.pkgs.pts.iozone import IOzone ioz = IOzone(self.test_path) logger.info(ioz.__doc__) self.assertTrue(ioz.benchmark()) @unittest.skipUnless(posix_ready(), "Not supported platform!") def test_postmark(self): """Simulate small-file testing similar to the tasks endured by web and mail servers""" from storagetest.pkgs.pts.postmark import PostMark pm = PostMark(self.test_path) logger.info(pm.__doc__) self.assertTrue(pm.benchmark()) # ==== Private ==== def test_consistency(self): """File consistency test""" from storagetest.pkgs.fileops import Consistency cst = Consistency(self.test_path) logger.info(cst.__doc__) self.assertTrue(cst.sanity())