<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 30, 2022 at 4:20 AM Rob Landley <<a href="mailto:rob@landley.net">rob@landley.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/29/22 19:22, enh via Toybox wrote:<br>
> ping? i saw you added another tar test, but let me know your thoughts on this<br>
> before i rebase and fix the new test...<br>
<br>
Sorry, under the weather all weekend (and today). Pascal's Apology probably<br>
applies to some of the emails I've sent, except instead of them being long due<br>
to lack of time they're long due to lack of focus...<br>
<br>
Applied. </blockquote><div><br></div><div>thanks! (i actually let slip a "woo hoo!" when i saw the github ci green again for the first time in many weeks!)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I wanted to clean it up to not be testing for darwin 13 separate times<br>
and haven't worked out how yet, but can do so later.</blockquote><div><br></div><div>since i'm the only one who actually has a mac (and, not coincidentally, the only one who really cares about mac tests in ci), any time there's something like that just let me know what you want and i can do it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> (I need some sort of group<br>
skip mechanic, ala "optional".  Which I note is only still used in<br>
tests/sort.test since I yanked most command sub-options, so I should probably<br>
revisit that too. A simple shell "if test; then ... fi" doesn't say "skipped"<br>
for the tests it skipped, and saying SKIPNEXT=5 instead of =1 and having it<br>
count down seems a bit brittle vs START/STOP marker...)<br></blockquote><div><br></div><div>ah, okay, yeah --- you can do the infrastructure :-)</div><div><br></div><div>i wished i'd had that too, but at the same time i was unconvinced we'd manage to keep things physically grouped like that, or that it would be clear without indentation, or that we'd be happy with the result even if we had the option.</div><div><br></div><div>i almost sent a patch that had a has_working_sparse_files variable instead, which at least seemed a bit more intention-revealing (and, tbh, i'm expecting that some day someone will report that one of the more exotic linux filesystems doesn't do sparse files properly!).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Also, the hashes changing when anything differs is frustrating. I wanted to be<br>
sure I was creating binary identical tarballs, and I am, but... is there a<br>
better way to test that? (WITHOUT having the output each thing's comparing<br>
against be 20 lines of hex dump... Maybe just a few tests can be hashes and the<br>
rest can be tar -tv or something? Skipping half the tests entirely and calling<br>
that "compliance" is frustrating. Yes the important thing is that it not fail,<br>
but passing a test by sabotaging the test is not ideal. Hmmm...)<br>
<br>
What _are_ the different permissions for a symlink on mac? </blockquote><div><br></div><div>they're actually in the script already: that's what <a href="https://github.com/landley/toybox/blob/master/tests/tar.test#L141">https://github.com/landley/toybox/blob/master/tests/tar.test#L141</a> is doing (for the tests that already use `tar tv` rather than SHAs). </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Could you hack<br>
something like this into your test (with VERBOSE=all and the darwin skipnots<br>
commented out) and run it on mac and send me the saved tarballs? I'd like to<br>
know what I'm up against...<br></blockquote><div><br></div><div>that doesn't work because testdir gets deleted? (and you can only run `make tests` on the mac, not `make test_tar` because the infrastructure for the latter assumes realpath, which doesn't exist on macOS.)</div><div><br></div><div>even putting a `sleep 666` at the end of tar.test, `find . -name save.*` doesn't find anything?</div><div><br></div><div>(anyway, like i say, i don't think you need this anyway because the hack for the appropriate expected permissions is already in the script if you just want to switch those tests from SHAs to `tar tv`?)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
--- a/tests/tar.test<br>
+++ b/tests/tar.test<br>
@@ -21,9 +21,12 @@ TAR='tar c --owner root --group sys --mtime @1234567890'<br>
<br>
 # Different tars add variable trailing NUL padding (1024 bytes is just minimum)<br>
 # so look at first N 512-byte frames when analyzing header content.<br>
+CHOCULA=1<br>
 function SUM()<br>
 {<br>
   tee save.dat | head -c $(($1*512)) | sha1sum | sed "s/ .*//"<br>
+  while [ -e "save.$CHOCULA" ]; do CHOCULA=$((CHOCULA+1)); done<br>
+  mv save.dat save.$CHOCULA<br>
 }<br>
<br>
 function LST()<br>
<br>
Rob<br>
<br>
P.S. Because SUM() gets run in a subshell so changes to CHOCULA get discarded no<br>
matter how you try to export them.<br>
<br>
P.P.S Pascal's apology again. Didn't say I was recovered, I'm just trying not to<br>
fall behind...<br>
</blockquote></div></div>