Hi,
Attached is a patch that adds a first stab at a testsuite for the acpi
utility, and a patch that fixes some of the issues with the ifconfig
testsuite.
1. Changed the context again... I tried running the tests on aboriginal
Linux, but it said there was no ip command, nor modprobe, which are two
alternatives to getting the dummy interface running. I didn't have much
success with the static-tools.hdc, but it said it couldn't find toybox, but
I tested the testsuite on Kali by invoking sudo make tests... hopefully
will work on platforms other than Kali.
2. Corrected the pretext of the pointotpoint tests
3. Corrections to the pointopoint tests -- spelling, intent, etc.
After playing with ifconfig all weekend, I've come to the grand conclusion
I can't find a way to get ifconfig pointopoint to set the POINTOPOINT
flag... The POINTOPOINT flag appears to be treated as an immutable feature
of the interface by ifconfig.
Other people in the past had the same issue.
http://www.linuxmisc.com/2-linux-networking/ccf70d924f2c289c.htm ,
http://www.linuxmisc.com/2-linux-networking/075ce6d1d544e8fb.htm
ifconfig interface localaddress pointopoint remoteaddress can be used
to configure ip address for tunnels (for Kali at least)...
So if ifconfig is changed to match the documentation, it will not match
Kali, and thus probably not Debian. Another option could be to clarify the
documentation...
Having gone through all that, and becoming slightly disappointed, I've
rewritten the ifconfig tests to reflect the defacto standard, over the
documentation, but the test can always be rewritten to reflect the
documentation over the defacto standard... if that's desired.
ACPI tests: according to Isaac Dunham, the author of the acpi utility,
there is no standard, so I compared the implemented features to their
counterparts implemented in Kali. The results were very satisfactory -- I
could use no options, reversed options, and got help when using illegal
options.
What would make the developing the tests much easier is a prebuilt image
with toybox configured with an allyesconfig (without nfs or nsenter, as
they don't seem to build on Kali).
Hope this helps,
Cindy
diff -r 4faace2c5245 tests/acpi.test
--- /dev/null Thu Jan 01 00:00:00 1970 +
+++ b/tests/acpi.test Sun Nov 30 06:46:26 2014 -0800
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Copyright 2014 Cynthia Rempel cynt...@rtems.org
+#
+# Purpose: Tests the acpi command.
+# Requires: grep -i, head -n, wc -l
+
+[ -f testing.sh ] . testing.sh
+
+#testing name command result infile stdin
+
+# Test Description: Call acpi with no arguments
+# Results Expected: The battery percentage
+testing acpi no arguments acpi | grep -i \Battery\ *[0-9]:\
*[0-9][0-9]*%\ | head -n 1 | wc -l \
+ 1\n
+
+# Test Description: Get the power adapters' status
+# Results Expected: Whether the adapters were online or offline
+testing acpi -a acpi -a | grep -i \Adapter\ *[0-9]*:\ *.*\-line\ | head
-n 1 | wc -l \
+ 1\n
+
+# Test Description: Get the status of the batteries
+# Results Expected: The battery percentage
+testing acpi -b acpi -b | grep -i \Battery\ *[0-9]:\ *[0-9][0-9]*%\ |
head -n 1 | wc -l \
+ 1\n
+
+# Test Description: Get descriptions of the cooling devices
+# Results Expected: A list of descriptions for cooling devices
+testing acpi -c acpi -c | grep -i \Cooling\ *[0-9]:\ .*\ | head -n 1 | wc
-l \
+1\n
+
+# Test Description: Get the temperature
+# Results Expected: A list of readings from temperature sensors
+testing acpi -t acpi -t | grep -i \Thermal\ *[0-9]:\ .*degrees\ | head -n
1 | wc -l \
+1\n
+
+# Test Description: Call acpi verbose
+# Results Expected: The battery percentage
+testing acpi -V battery percentage acpi -V | grep -i \Battery\ *[0-9]:\
*[0-9][0-9]*%\ | head -n 1 | wc -l \
+1\n
+
+# Test Description: Get the power adapters' status
+# Results Expected: Whether the adapters were online or offline
+testing acpi -ab acpi -ab | grep -i \Adapter\ *[0-9]*:\ *.*\-line\ | head
-n 1 | wc -l \
+1\n
+
+# Test Description: Get the status of the batteries
+# Results Expected: The battery percentage
+testing acpi -ba acpi -ba | grep -i \Battery\ *[0-9]:\ *[0-9][0-9]*%\ |
head -n 1 | wc -l \
+1\n
+
+# Test Description: Call an unknown option
+# Results Expected: The usage sent to standard error
+testing acpi -bh acpi -bh | grep -i \usage\ | head -n 1 | wc -l \
+1\n
diff -r 4faace2c5245 tests/ifconfig.test
--- a/tests/ifconfig.test Thu Nov 27 00:28:13 2014 -0600
+++ b/tests/ifconfig.test Sun Nov 30 21:02:57 2014 -0800
@@ -2,8 +2,8 @@
# Copyright 2014 Cynthia Rempel cynt...@rtems.org
#
# Brief: Some cursery coverage tests of ifconfig...
-# Note: requires permissions to run modprobe and all ifconfig options
-# Commands used: grep, grep -i, ip link, ip tuntap, wc -l
+# Note: requires permissions to run all ifconfig options
+# Commands used: grep, grep -i, ip li add dummy, wc -l
#
#