summaryrefslogtreecommitdiffstats
path: root/tests/sys/geom/class/nop/2_test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys/geom/class/nop/2_test.sh')
-rw-r--r--tests/sys/geom/class/nop/2_test.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/sys/geom/class/nop/2_test.sh b/tests/sys/geom/class/nop/2_test.sh
new file mode 100644
index 0000000..7422345
--- /dev/null
+++ b/tests/sys/geom/class/nop/2_test.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+# $FreeBSD$
+
+. `dirname $0`/conf.sh
+
+src=`mktemp $base.XXXXXX` || exit 1
+dst=`mktemp $base.XXXXXX` || exit 1
+
+echo "1..1"
+
+dd if=/dev/random of=${src} bs=1m count=1 >/dev/null 2>&1
+
+us=$(attach_md -t malloc -s 1M) || exit 1
+
+gnop create /dev/${us} || exit 1
+
+dd if=${src} of=/dev/${us}.nop bs=1m count=1 >/dev/null 2>&1
+dd if=/dev/${us}.nop of=${dst} bs=1m count=1 >/dev/null 2>&1
+
+if [ `md5 -q ${src}` != `md5 -q ${dst}` ]; then
+ echo "not ok 1"
+else
+ echo "ok 1"
+fi
+
+rm -f ${src} ${dst}
OpenPOWER on IntegriCloud