From: Ralph Boehme Date: Fri, 17 Nov 2017 11:57:14 +0000 (+0100) Subject: s4/torture: fruit: in test_adouble_conversion() also check stream list and AFPINFO_STREAM X-Git-Tag: samba-4.6.12~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7f5e69abc5b6c10b0f18e5cee6f94c3b33acb33;p=thirdparty%2Fsamba.git s4/torture: fruit: in test_adouble_conversion() also check stream list and AFPINFO_STREAM This reveals that the conversion doesn't work properly with fruit:metadata=stream. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13155 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison (backported from commit 7b00b558761b6564928289efcf835e9b9cc86a89) --- diff --git a/selftest/knownfail b/selftest/knownfail index 6e1d0589922..b6a9e6d0766 100644 --- a/selftest/knownfail +++ b/selftest/knownfail @@ -308,3 +308,4 @@ ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_rank_none.* ^samba.tests.dcerpc.dnsserver.samba.tests.dcerpc.dnsserver.DnsserverTests.test_security_descriptor.* ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\) +^samba3.vfs.fruit metadata_stream.OS X AppleDouble file conversion\(nt4_dc\) diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index c40eca1aa28..76890ff75e0 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -1959,6 +1959,13 @@ static bool test_adouble_conversion(struct torture_context *tctx, bool ret = true; const char *data = "This resource fork intentionally left blank"; size_t datalen = strlen(data); + const char *streams[] = { + "::$DATA", + AFPINFO_STREAM, + AFPRESOURCE_STREAM, + ":com.apple.metadata" "\xef\x80\xa2" "_kMDItemUserTags:$DATA", + ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */ + }; smb2_deltree(tree, BASEDIR); @@ -1989,12 +1996,21 @@ static bool test_adouble_conversion(struct torture_context *tctx, torture_assert_goto(tctx, ret == true, ret, done, "check AFPRESOURCE_STREAM failed\n"); + ret = check_stream(tree, __location__, tctx, mem_ctx, + fname, AFPINFO_STREAM, + 0, 60, 16, 8, "TESTSLOW"); + torture_assert_goto(tctx, ret == true, ret, done, + "check AFPINFO_STREAM failed\n"); + ret = check_stream(tree, __location__, tctx, mem_ctx, fname, ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */ 0, 3, 0, 3, "baz"); torture_assert_goto(tctx, ret == true, ret, done, "check foo:bar stream failed\n"); + ret = check_stream_list(tree, tctx, fname, 5, streams, false); + torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list"); + done: smb2_deltree(tree, BASEDIR); talloc_free(mem_ctx);