diff mbox series

[for,7.0,4/5] smoke-bsd-user: A test script to run all the FreeBSD binaries

Message ID 20211127201846.64187-5-imp@bsdimp.com
State New
Headers show
Series bsd-user-smoke: A simple smoke test for bsd-user | expand

Commit Message

Warner Losh Nov. 27, 2021, 8:18 p.m. UTC
Simple shell script to iterate through all the FreeBSD binaries running
qemu-$binary to ensure that we have minimal functionality for each
platform. When more of the bsd-user fork has been upstreamed, this
will be replaced by more extensive regresion tests.

Signed-off-by: Warner Losh <imp@bsdimp.com>
---
 tests/bsd-user-smoke/smoke-bsd-user | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 tests/bsd-user-smoke/smoke-bsd-user
diff mbox series

Patch

diff --git a/tests/bsd-user-smoke/smoke-bsd-user b/tests/bsd-user-smoke/smoke-bsd-user
new file mode 100644
index 00000000000..20818fdf918
--- /dev/null
+++ b/tests/bsd-user-smoke/smoke-bsd-user
@@ -0,0 +1,22 @@ 
+#!/bin/sh
+
+build=$1
+testing=$2
+
+smoke_one() {
+	local a=$1 q=$2
+
+	echo Hello World > foo1
+	$build/qemu-$q $testing/h.$a > foo2 || die "cmd failed: $build/qemu-$q $testing/h.$a"
+	cmp foo1 foo2 || die "Hello World expected"
+	rm foo1 foo2
+}
+
+die() {
+	echo $1
+	exit 1
+}
+
+smoke_one amd64 x86_64
+smoke_one armv7 arm
+smoke_one i386 i386