diff options
Diffstat (limited to 'test/py/tests/test_fs/test_unlink.py')
-rw-r--r-- | test/py/tests/test_fs/test_unlink.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/test/py/tests/test_fs/test_unlink.py b/test/py/tests/test_fs/test_unlink.py index 7e911f02413..1e2df3dbfd8 100644 --- a/test/py/tests/test_fs/test_unlink.py +++ b/test/py/tests/test_fs/test_unlink.py @@ -19,16 +19,16 @@ class TestUnlink(object): """ Test Case 1 - delete a file """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 1 - unlink (file)'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir1/file1' % fs_type, - '%sls host 0:0 dir1/file1' % fs_type]) + '%srm host 0:0 dir1/file1' % fs_cmd_prefix, + '%sls host 0:0 dir1/file1' % fs_cmd_prefix]) assert('' == ''.join(output)) output = ubman.run_command( - '%sls host 0:0 dir1/' % fs_type) + '%sls host 0:0 dir1/' % fs_cmd_prefix) assert(not 'file1' in output) assert('file2' in output) assert_fs_integrity(fs_type, fs_img) @@ -37,18 +37,18 @@ class TestUnlink(object): """ Test Case 2 - delete many files """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 2 - unlink (many)'): output = ubman.run_command('host bind 0 %s' % fs_img) for i in range(0, 20): output = ubman.run_command_list([ - '%srm host 0:0 dir2/0123456789abcdef%02x' % (fs_type, i), - '%sls host 0:0 dir2/0123456789abcdef%02x' % (fs_type, i)]) + '%srm host 0:0 dir2/0123456789abcdef%02x' % (fs_cmd_prefix, i), + '%sls host 0:0 dir2/0123456789abcdef%02x' % (fs_cmd_prefix, i)]) assert('' == ''.join(output)) output = ubman.run_command( - '%sls host 0:0 dir2' % fs_type) + '%sls host 0:0 dir2' % fs_cmd_prefix) assert('0 file(s), 2 dir(s)' in output) assert_fs_integrity(fs_type, fs_img) @@ -56,11 +56,11 @@ class TestUnlink(object): """ Test Case 3 - trying to delete a non-existing file should fail """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 3 - unlink (non-existing)'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir1/nofile' % fs_type]) + '%srm host 0:0 dir1/nofile' % fs_cmd_prefix]) assert('nofile: doesn\'t exist' in ''.join(output)) assert_fs_integrity(fs_type, fs_img) @@ -68,15 +68,15 @@ class TestUnlink(object): """ Test Case 4 - delete an empty directory """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 4 - unlink (directory)'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir4' % fs_type]) + '%srm host 0:0 dir4' % fs_cmd_prefix]) assert('' == ''.join(output)) output = ubman.run_command( - '%sls host 0:0 /' % fs_type) + '%sls host 0:0 /' % fs_cmd_prefix) assert(not 'dir4' in output) assert_fs_integrity(fs_type, fs_img) @@ -85,11 +85,11 @@ class TestUnlink(object): Test Case 5 - trying to deleting a non-empty directory ".." should fail """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 5 - unlink ("non-empty directory")'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir5' % fs_type]) + '%srm host 0:0 dir5' % fs_cmd_prefix]) assert('directory is not empty' in ''.join(output)) assert_fs_integrity(fs_type, fs_img) @@ -97,11 +97,11 @@ class TestUnlink(object): """ Test Case 6 - trying to deleting a "." should fail """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 6 - unlink (".")'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir5/.' % fs_type]) + '%srm host 0:0 dir5/.' % fs_cmd_prefix]) assert('directory is not empty' in ''.join(output)) assert_fs_integrity(fs_type, fs_img) @@ -109,10 +109,10 @@ class TestUnlink(object): """ Test Case 7 - trying to deleting a ".." should fail """ - fs_type,fs_img = fs_obj_unlink + fs_type,fs_cmd_prefix,fs_img = fs_obj_unlink with ubman.log.section('Test Case 7 - unlink ("..")'): output = ubman.run_command_list([ 'host bind 0 %s' % fs_img, - '%srm host 0:0 dir5/..' % fs_type]) + '%srm host 0:0 dir5/..' % fs_cmd_prefix]) assert('directory is not empty' in ''.join(output)) assert_fs_integrity(fs_type, fs_img) |