[Toybox] Heads up on the sed N behavior change.
Rob Landley
rob at landley.net
Tue Sep 13 20:54:57 PDT 2022
On 9/13/22 16:25, enh wrote:
> i'll keep an eye out, but since we _came_ from GNU sed, yeah, i'd be surprised
> if we'd introduced any POSIX assumptions since then.
>
> for now though any update is still blocked on the chattr test breakage from
> SKIPNEXT...
Ah, didn't know that was blocking you. (The chattr tests don't run here because
the number of - output by chattr, on both debian and toybox's version, is off by
one from what the tests expect. It's still ext4, but...?)
Anyway, took a blind stab at it, does 0fa628026cb3 fix it for you?
I note that:
-touch testFile; chattr -v 1234 testFile 2>/dev/null || SKIPNEXT=1
+touch testFile && chattr -v 1234 testFile 2>/dev/null || ((++SKIP))
I did that because it looked wrong otherwise, but that _could_ change behavior
for you...?
> -- chattr
Sigh, more of Divya's tests. I tried to clean them up, but am still not always
sure what they were intended to prove. Let's see...
> /system/bin/sh: /data/local/tmp/toybox-tests/runtest.sh[222]: syntax error:
> unexpected operator/operand '=~'
Hmmm, I thought only sh was using the expect plumbing... ah right, mksh aborts
processing that file with a syntax error but resumes the file that sourced it
(the source produces an error rc but nothing checks it and everything sourced
BEFORE then is populated, so... cosmetic but I should still fix. I have the todo
item but haven't done it yet because the *pat* thing isn't right and toysh is SO
CLOSE to being able to run the test suite. I've been distracted from that...)
Right, not part of the failure you were seeing, just general noise I need to fix.
> /system/bin/sh: can't create testFile: Operation not permitted
> rm: testFile: Operation not permitted
> PASS: chattr immutable
> /system/bin/sh: can't create testFile: Operation not permitted
> PASS: chattr append-only
ALSO noise. Noisy but not failing. How is the test NOT failing? (No line numbers
for the failures, that's nice of the shell...)
Um, your commit ac932250f8ba seems to have changed these tests into something
that passes if chattr fails? What exactly is this testing?
> PASS: chattr toggle A
> PASS: chattr toggle d
> FAIL: chattr toggle e
> echo -ne '' | lsattr testFile | awk '{print $1}' > attrs;
> grep -q e attrs || cat attrs; cat testFile && chattr -e testFile &&
> lsattr testFile | clean; rm -rf testFile
> --- expected 2022-09-10 02:15:53.519998810 +0000
> +++ actual 2022-09-10 02:15:53.559998809 +0000
> @@ -1,2 +1,3 @@
> +---------E----------
> abcdefghijklmnopqrstuvwxyz
> -------------------- testFile
Well, hopefully it's skipping that now, although disabling the test if what we'd
be testing doesn't work is... kind of strange? (Again, what does this test
actually demonstrate? What have we proved by running it? I'm confused!)
It's a test that requires root to run so it's in my "run under mkroot" bucket,
but still...
Rob
More information about the Toybox
mailing list