Skip to content

Commit

Permalink
Merge pull request #487 from yoguo/master
Browse files Browse the repository at this point in the history
Change the blktests config and results paths as /usr is read-only
  • Loading branch information
yoguo authored Nov 29, 2024
2 parents 094bf4f + 96f6bae commit 0ce38c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion os_tests/libs/utils_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,8 @@ def get_test_disk(test_instance=None):
cmd = "lsblk -r --output NAME,MOUNTPOINT|awk -F' ' '{if($2) printf\"%s \",$1}'"
output = run_cmd(test_instance, cmd, expect_ret=0)
mount_disks = output.split(' ')
cmd = 'lsblk -d --output NAME|grep -v NAME'
# Filter out loop and zram (swap) devices in image mode
cmd = 'lsblk -d --output NAME|grep -v NAME|grep -v zram|grep -v loop'
output = run_cmd(test_instance, cmd, expect_ret=0)
disk_list = output.split('\n')
for disk in disk_list:
Expand Down
6 changes: 4 additions & 2 deletions os_tests/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ def _blktests_run(self, case_name=None):
test_instance {avocado Test instance} -- avocado test instance
'''
test_disk = "/dev/{}".format(utils_lib.get_test_disk(self))
cmd = "sudo bash -c \"echo 'TEST_DEVS=({})' > /usr/local/blktests/config\"".format(test_disk)
config = "/tmp/blktests_config"
cmd = "sudo bash -c \"echo 'TEST_DEVS=({})' > {}\"".format(test_disk, config)
utils_lib.run_cmd(self, cmd, expect_ret=0)
cmd = "cd /usr/local/blktests/; sudo ./check {}".format(case_name)
results_dir = "/tmp/blktests_results"
cmd = "cd /usr/local/blktests/; sudo ./check {} -c {} -o {}".format(case_name, config, results_dir)
utils_lib.run_cmd(self, cmd, expect_ret=0, expect_not_kw="failed", timeout=2400)

def setUp(self):
Expand Down

0 comments on commit 0ce38c2

Please sign in to comment.