diff options
author | Ralph Boehme <slow@samba.org> | 2015-12-18 17:10:18 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2016-01-06 10:07:15 +0100 |
commit | 6a9f21cc91965ea11a4fb90a84e583c338aa8ef6 (patch) | |
tree | c69af6d37b50d02d5157f6830d2b082ff6f74c82 | |
parent | 6dba57ef8d450ddbb84a7604d743575144c49d6b (diff) | |
download | samba-6a9f21cc91965ea11a4fb90a84e583c338aa8ef6.tar.gz |
s4:torture:vfs_fruit: skip test test_read_atalk_metadata() without "localdir" and rename it
The test is Netatalk specific. Skip the test if "localdir" is not
specified.
Use torture_assert() to check the result from check_stream().
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 0a9a7c21073227c539fc1ced331e837c1c1f4bc4)
-rw-r--r-- | source4/torture/vfs/fruit.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index 9f5e739bb07..900870f12be 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -1264,8 +1264,8 @@ done: return ret; } -static bool test_read_atalk_metadata(struct torture_context *tctx, - struct smb2_tree *tree) +static bool test_read_netatalk_metadata(struct torture_context *tctx, + struct smb2_tree *tree) { TALLOC_CTX *mem_ctx = talloc_new(tctx); const char *fname = BASEDIR "\\torture_read_metadata"; @@ -1273,9 +1273,15 @@ static bool test_read_atalk_metadata(struct torture_context *tctx, struct smb2_handle testdirh; bool ret = true; ssize_t len; + const char *localdir = NULL; torture_comment(tctx, "Checking metadata access\n"); + localdir = torture_setting_string(tctx, "localdir", NULL); + if (localdir == NULL) { + torture_skip(tctx, "Need localdir for test"); + } + smb2_util_unlink(tree, fname); status = torture_smb2_testdir(tree, BASEDIR, &testdirh); @@ -1295,14 +1301,17 @@ static bool test_read_atalk_metadata(struct torture_context *tctx, goto done; } - ret &= check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, - 0, 60, 0, 4, "AFP"); + ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, + 0, 60, 0, 4, "AFP"); + torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed"); - ret &= check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, - 0, 60, 16, 8, "BARRFOOO"); + ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, + 0, 60, 16, 8, "BARRFOOO"); + torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed"); - ret &= check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, - 16, 8, 0, 8, "BARRFOOO"); + ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM, + 16, 8, 0, 8, "BARRFOOO"); + torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed"); /* Check reading offset and read size > sizeof(AFPINFO_STREAM) */ @@ -2772,7 +2781,7 @@ struct torture_suite *torture_vfs_fruit(void) suite->description = talloc_strdup(suite, "vfs_fruit tests"); torture_suite_add_1smb2_test(suite, "copyfile", test_copyfile); - torture_suite_add_1smb2_test(suite, "read metadata", test_read_atalk_metadata); + torture_suite_add_1smb2_test(suite, "read netatalk metadata", test_read_netatalk_metadata); torture_suite_add_1smb2_test(suite, "write metadata", test_write_atalk_metadata); torture_suite_add_1smb2_test(suite, "resource fork IO", test_write_atalk_rfork_io); torture_suite_add_1smb2_test(suite, "OS X AppleDouble file conversion", test_adouble_conversion); |