On 12/3/19 11:02 AM, enh via Toybox wrote:
> ::2 can legitimately be part of an IPv6 address, causing the test to
> fail because the grep matches an unrelated part of the output. Be more
> explicit about what we're actually searching for (as the previous test
> already was) to avoid flakiness.

If you have an english description of the test that's well under 80 characters,
why not just have that be the test description instead of a comment?

I tend to indent continuation lines.

I'm not sure what this is trying to accomplish:
  $ echo grep 10\.240\.240\.240
  grep 10.240.240.240

The shell eats the backslash and it's still a wildcard for grep. (This isn't a
quoting thing, this is an eval thing.)

Hmmm, I'd apply the attached (and continue on) except I don't have a qemu test
instance with the dummy driver set up. I should spend a half an hour doing that.
(Sigh. It's a pity Google never wanted to hire me to work on the test suite back
when I had spare time. I'm off doing j-core stuff again, I _think_ I fly back to
tokyo in a day or two? Waiting to hear how a planning meeting goes this 
evening...)

Rob

P.S. my blog is caught up to present! https://landley.net/notes.html has
yesterday's entry already for the first time in _years_. I'd like to thank the
academy, by which I mean the https://patreon.com/landley people who made my
lowest goal level, which was "get my development blog up to date"... You may
have noticed me posting slightly less here, since my constant toybox redesigns
and code frogging have been going there instead.
diff --git a/tests/ifconfig.test b/tests/ifconfig.test
index 631e088..d49145f 100755
--- a/tests/ifconfig.test
+++ b/tests/ifconfig.test
@@ -19,6 +19,8 @@
 #    outfill|keepalive INTEGER - SLIP analog dialup line quality monitoring
 #    metric INTEGER - added to Linux 0.9.10 with comment "never used", still true
 
+#testing "name" "command" "result" "infile" "stdin"
+
 [ -f testing.sh ] && . testing.sh
 
 if [ "$(id -u)" -ne 0 ]
@@ -28,8 +30,6 @@ then
   exit
 fi
 
-#testing "name" "command" "result" "infile" "stdin"
-
 # Add a dummy interface to test with
 modprobe dummy 2>/dev/null
 if ! ifconfig dummy0 up 2>/dev/null
@@ -39,38 +39,31 @@ then
   exit
 fi
 
-# Test Description: Disable the dummy0 interface
 # Results Expected: After calling ifconfig, no lines with dummy0 are displayed
-testing "dummy0 down and if config /-only" \
-"ifconfig dummy0 down && ifconfig | grep dummy | wc -l" \
-"0\n" "" ""
+testing "Disable the dummy0 interface"
+  "ifconfig dummy0 down && ifconfig | grep dummy | wc -l" "0\n" "" ""
 
-# Test Description: Enable the dummy0 interface
 # Results Expected: After calling ifconfig, one line with dummy0 is displayed
-testing "dummy0 up" \
-"ifconfig dummy0 up && ifconfig dummy0 | grep dummy | wc -l" \
-"1\n" "" ""
+testing "Enable the dummy0 interface" \
+  "ifconfig dummy0 up && ifconfig dummy0 | grep dummy | wc -l" "1\n" "" ""
 
-# Test Description: Set the ip address of the dummy0 interface
 # Results Expected: After calling ifconfig dummy0, one line displays the ip
 #                   address selected
-testing "dummy0 10.240.240.240" \
-"ifconfig dummy0 10.240.240.240 && ifconfig dummy0 | grep 10\.240\.240\.240 | wc -l" \
-"1\n" "" ""
+testing "Set the ip address of the dummy0 interface" \
+  "ifconfig dummy0 10.240.240.240 && ifconfig dummy0 | grep 10\.240\.240\.240 | wc -l" \
+  "1\n" "" ""
 
-# Test Description: Change the netmask to the interface
 # Results Expected: After calling ifconfig dummy0, one line displays the
 #                   netmask selected
-testing "dummy0 netmask 255.255.240.0" \
-"ifconfig dummy0 netmask 255.255.240.0 && ifconfig dummy0 | grep 255\.255\.240\.0 | wc -l" \
-"1\n" "" ""
+testing "Change the netmask to the interface" \
+  "ifconfig dummy0 netmask 255.255.240.0 && ifconfig dummy0 | grep 255\.255\.240\.0 | wc -l" \
+  "1\n" "" ""
 
-# Test Description: Change the broadcast address to the interface
 # Results Expected: After calling ifconfig dummy0, one line displays the
 #                   broadcast address selected
-testing "dummy0 broadcast 10.240.240.255" \
-"ifconfig dummy0 broadcast 10.240.240.255 && ifconfig dummy0 | grep 10\.240\.240\.255 | wc -l" \
-"1\n" "" ""
+testing "Change the broadcast address to the interface" \
+  "ifconfig dummy0 broadcast 10.240.240.255 && ifconfig dummy0 | grep 10\.240\.240\.255 | wc -l" \
+  "1\n" "" ""
 
 # Test Description: Revert to the default ip address
 # Results Expected: After calling ifconfig dummy0, there are no lines
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to