Module Name: src
Committed By: kre
Date: Thu Feb 23 02:09:24 UTC 2017
Modified Files:
src/tests/usr.bin/mixerctl: t_mixerctl.sh
Log Message:
Skip most of the mixerctl tests when running under QEMU (assumed to be for ATF)
as the kernel that runs them has no audio (and no mixers) configured.
The usage message test might be returned some day if /usr/bin/mixerctl
gets modified so it doesn't attempt to open the device (and error out)
in cases where the device isn't actually going to be used (and -d wasn't
given to set the device name explicitly).
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/mixerctl/t_mixerctl.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/mixerctl/t_mixerctl.sh
diff -u src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.1 src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.2
--- src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.1 Mon Jan 2 15:40:09 2017
+++ src/tests/usr.bin/mixerctl/t_mixerctl.sh Thu Feb 23 02:09:24 2017
@@ -1,10 +1,16 @@
-# $NetBSD: t_mixerctl.sh,v 1.1 2017/01/02 15:40:09 christos Exp $
+# $NetBSD: t_mixerctl.sh,v 1.2 2017/02/23 02:09:24 kre Exp $
atf_test_case noargs_usage
noargs_usage_head() {
atf_set "descr" "Ensure mixerctl(1) with no args prints a usage message"
}
noargs_usage_body() {
+ if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+ then
+ # better would be for mixerctl to not open the device...
+ # but for now, it does.
+ atf_skip "ATF qemu kernel has no audio"
+ fi
atf_check -s exit:0 -o not-empty -e ignore \
mixerctl
}
@@ -14,6 +20,10 @@ showvalue_head() {
atf_set "descr" "Ensure mixerctl(1) can print the value for all variables"
}
showvalue_body() {
+ if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+ then
+ atf_skip "ATF qemu kernel has no audio"
+ fi
for var in $(mixerctl -a | awk -F= '{print $1}'); do
atf_check -s exit:0 -e ignore -o match:"^${var}=" \
mixerctl ${var}
@@ -25,7 +35,11 @@ nflag_head() {
atf_set "descr" "Ensure 'mixerctl -n' actually suppresses some output"
}
nflag_body() {
- varname="$(mixerctl -a | head -1 | awk -F= '{print $1}')"
+ if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
+ then
+ atf_skip "ATF qemu kernel has no audio"
+ fi
+ varname="$(mixerctl -a | sed -e 's/=.*//' -e q)"
atf_check -s exit:0 -o match:"${varname}" -e ignore \
mixerctl ${varname}