Home | History | Annotate | Download | only in samples
      1 AUTHOR = "Autotest Team <autotest (a] test.kernel.org>"
      2 TIME = "MEDIUM"
      3 NAME = "Sample - Filesystem tests with different fs options"
      4 TEST_TYPE = "client"
      5 TEST_CLASS = "Kernel"
      6 TEST_CATEGORY = "Functional"
      7 
      8 DOC = """
      9 Runs a series of filesystem tests on a loopback partition. This shows some
     10 features of the job.partition method, such as creating loopback partitions
     11 instead of using real disk partitions, looping and tags.
     12 """
     13 
     14 partition = job.partition(device='/tmp/looped', loop_size=1024,
     15                           mountpoint=job.tmpdir)
     16 # You can use also 'real' partitions, just comment the above and uncomment
     17 # the below
     18 #partition = job.partition('/dev/sdb1', job.tmpdir)
     19 
     20 iters = 10
     21 
     22 for fstype, mountopts, tag in (('ext2', '', 'ext2'),
     23                                ('ext3', '-o data=writeback', 'ext3writeback'),
     24                                ('ext3', '-o data=ordered', 'ext3ordered'),
     25                                ('ext3', '-o data=journal', 'ext3journal'),
     26                                ('ext4', '-o data=ordered', 'ext4ordered'),
     27                                ('ext4', '-o data=journal', 'ext4journal'),):
     28     partition.mkfs(fstype)
     29     partition.mount(args=mountopts)
     30     try:
     31         job.run_test('fsx', dir=job.tmpdir, tag=tag)
     32         job.run_test('iozone', dir=job.tmpdir, iterations=iters, tag=tag)
     33         job.run_test('dbench', iterations=iters, dir=job.tmpdir, tag=tag)
     34         job.run_test('tiobench', dir=job.tmpdir, tag=tag)
     35     finally:
     36         partition.unmount()
     37