Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Fix composefs test #2923

Merged
merged 2 commits into from
Jul 7, 2023
Merged

Conversation

alexlarsson
Copy link
Member

This was using the wrong metadata key and had an old digest.

Split out from #2922

@alexlarsson
Copy link
Member Author

I have no idea why this test failed here. It works locally, and it worked in #2922

@cgwalters
Copy link
Member

Hmm I'm getting a different digest...(time passes)

Ah of course...I think it's the selinux xattrs. I have them on this Fedora host, but Debian doesn't. Oh wait...or maybe it's the other way around? Huh...I think the test suite is actually disabling xattrs in my toolbox container but that may not be happenining in the debian setup?

Testing...

@cgwalters cgwalters force-pushed the fix-composefs-test branch from bd9b011 to 176d2be Compare July 7, 2023 13:16
@cgwalters cgwalters enabled auto-merge July 7, 2023 13:17
@cgwalters cgwalters disabled auto-merge July 7, 2023 13:22
The default GVariant output for byte arrays is illegible to humans,
and byte arrays are super common for us.
@alexlarsson
Copy link
Member Author

I tried the latest version of this branch locally on f38 and I get the same digest as the debian latest CI does (7251d9ecbc60177debde3532c824199f739d2a1e87f3a83021eeb6ed5eecb6ff).

@cgwalters Do you get 4d97f295ac9d379b7b3c42ddec49cc55b570c5b8b2a6f3f835f473854b0ad0cd on your box?

@cgwalters
Copy link
Member

I'm running in a f38 toolbox container. Hmm can you give this a quick try?

diff --git a/tests/test-composefs.sh b/tests/test-composefs.sh
index b6fd447b..ad8a27ad 100755
--- a/tests/test-composefs.sh
+++ b/tests/test-composefs.sh
@@ -31,6 +31,8 @@ cd ${test_tmpdir}
 $OSTREE checkout test2 test2-co
 COMMIT_ARGS="--owner-uid=0 --owner-gid=0 --no-xattrs --canonical-permissions"
 $OSTREE commit ${COMMIT_ARGS} -b test-composefs --generate-composefs-metadata test2-co
+$OSTREE ls -RCX test-composefs /
+exit 1
 orig_composefs_digest=$($OSTREE show --print-hex --print-metadata-key ostree.composefs.digest.v0 test-composefs)
 $OSTREE commit ${COMMIT_ARGS} -b test-composefs2 --generate-composefs-metadata test2-co
 new_composefs_digest=$($OSTREE show --print-hex --print-metadata-key ostree.composefs.digest.v0 test-composefs2)

I get:

d00755 0 0      0 362d5016fc65c414e504218268bdf4814754bf2bb15a1174f3eb6dce859a3e1f 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /
-00644 0 0      6 72025f89381e39d03baeb8605d7caa013b4f628605b8acc95ec2bffc7432ba0f { @a(ayay) [] } /firstfile
l00777 0 0      0 9ff5ce08bbacb2eec3ce74936fea67eaad019b87989c24d6e80fc90787e95a48 { @a(ayay) [] } /somelink -> nosuchfile
d00755 0 0      0 eed7ebb39ec6f68fc179b18278a16fa121294f0991211969b83598b142ef45f7 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz
l00777 0 0      0 c8191d2474aa8509dc3f6214193f5a0c3d5fa814359ca910c8e1d962def1c1ed { @a(ayay) [] } /baz/alink -> nonexistent
-00644 0 0      4 f6a517d53831a40cff3886a965c70d57aa50797a8e5ea965b2c49cc575a6ff51 { @a(ayay) [] } /baz/cow
-00600 0 0      6 cdcf4b15fd075eac0d8649f4fd7b4ffcee3739af84e78bf3910c8242ebac1ac1 { @a(ayay) [] } /baz/cowro
-00644 0 0      6 cd96f3f802dd20400b05aa7348b558fa33254c06aecaead04d48a9335cb9eca1 { @a(ayay) [] } /baz/saucer
d00755 0 0      0 199bff60fa09e0585a3a4057f1af9c52c5f11b1c216b02e3829b84c0a91936e9 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz/another
-00644 0 0      2 90bb74838c1594a2bcad43400970f0d03e4e0b8fcdd9398c86fc92e3d0506f9c { @a(ayay) [] } /baz/another/y
d00755 0 0      0 454348c57a2bc714a34efb3cd521f845c25efdafd9080392393609b3d13fdcb5 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz/deeper
-00644 0 0      3 fbf7cf77a1b50d9f074cb6e9ef6ddb65b6532ea89e4f4ca1b07a05b4cd1be259 { @a(ayay) [] } /baz/deeper/ohyeah

@alexlarsson
Copy link
Member Author

Uhm, I get:

d00755 0 0      0 227a446fdbdd24ea05a2c60e252e686170eef2bda689b0fed93389e119fda6eb 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /
-00644 0 0      6 72025f89381e39d03baeb8605d7caa013b4f628605b8acc95ec2bffc7432ba0f { @a(ayay) [] } /firstfile
l00777 0 0      0 9ff5ce08bbacb2eec3ce74936fea67eaad019b87989c24d6e80fc90787e95a48 { @a(ayay) [] } /somelink -> nosuchfile
d00755 0 0      0 eed7ebb39ec6f68fc179b18278a16fa121294f0991211969b83598b142ef45f7 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz
l00777 0 0      0 c8191d2474aa8509dc3f6214193f5a0c3d5fa814359ca910c8e1d962def1c1ed { @a(ayay) [] } /baz/alink -> nonexistent
-00644 0 0      4 f6a517d53831a40cff3886a965c70d57aa50797a8e5ea965b2c49cc575a6ff51 { @a(ayay) [] } /baz/cow
-00600 0 0      6 cdcf4b15fd075eac0d8649f4fd7b4ffcee3739af84e78bf3910c8242ebac1ac1 { @a(ayay) [] } /baz/cowro
-00644 0 0      6 cd96f3f802dd20400b05aa7348b558fa33254c06aecaead04d48a9335cb9eca1 { @a(ayay) [] } /baz/saucer
d00755 0 0      0 199bff60fa09e0585a3a4057f1af9c52c5f11b1c216b02e3829b84c0a91936e9 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz/another
-00644 0 0      2 90bb74838c1594a2bcad43400970f0d03e4e0b8fcdd9398c86fc92e3d0506f9c { @a(ayay) [] } /baz/another/y
d00755 0 0      0 454348c57a2bc714a34efb3cd521f845c25efdafd9080392393609b3d13fdcb5 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /baz/deeper
-00644 0 0      3 fbf7cf77a1b50d9f074cb6e9ef6ddb65b6532ea89e4f4ca1b07a05b4cd1be259 { @a(ayay) [] } /baz/deeper/ohyeah
-00755 0 0      4 9e16065db4626068b0a0941669cd56d481d22932c89b277732620889774ee016 { @a(ayay) [] } /baz/deeper/ohyeahx
d00755 0 0      0 cdf9489c36f7bed925031510bbe13bf2739f237f206272e075640164cba87993 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 { @a(ayay) [] } /whiteouts
-00644 0 0      0 cc700d46f407c6c5ab2d5dde474366a928b7398277e61162e7f8ec06f469f07e { @a(ayay) [] } /whiteouts/.ostree-wh.whiteout

@alexlarsson
Copy link
Member Author

# if we are running inside a container we cannot test
# the overlayfs whiteout marker passthrough
if ! test -n "${OSTREE_NO_WHITEOUTS:-}"; then
    mkdir whiteouts
    touch whiteouts/.ostree-wh.whiteout
    touch whiteouts/.ostree-wh.whiteout2
    chmod 755 whiteouts/.ostree-wh.whiteout2
fi

@alexlarsson
Copy link
Member Author

So, either have two possible digests, or use a different commit to compare against?

- Was using the wrong metadata key
- We were missing setting the canonical commit args which assigns
  e.g. owner uid 0, which is important for reproducibility
- Use the new --print-hex to make things easier to read
@cgwalters cgwalters force-pushed the fix-composefs-test branch from 4baf3a4 to 62e4f37 Compare July 7, 2023 13:57
@cgwalters
Copy link
Member

Ahhhh! Right, obvious in retrospect just looking at the code. (Hmm, we need a saner and more representative set of "canonical filesystem trees to test")

I took a crack at a fix.

@cgwalters cgwalters enabled auto-merge July 7, 2023 14:12
@cgwalters cgwalters merged commit 5b72775 into ostreedev:main Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants