Module Name:    src
Committed By:   pooka
Date:           Mon Dec  6 15:54:00 UTC 2010

Modified Files:
        src/tests/util: t_dd.sh

Log Message:
test for 'dd seek='  (could be improved, but at least we have something now)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/util/t_dd.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/util/t_dd.sh
diff -u src/tests/util/t_dd.sh:1.2 src/tests/util/t_dd.sh:1.3
--- src/tests/util/t_dd.sh:1.2	Wed Apr 30 13:11:00 2008
+++ src/tests/util/t_dd.sh	Mon Dec  6 15:54:00 2010
@@ -1,4 +1,4 @@
-# $NetBSD: t_dd.sh,v 1.2 2008/04/30 13:11:00 martin Exp $
+# $NetBSD: t_dd.sh,v 1.3 2010/12/06 15:54:00 pooka Exp $
 #
 # Copyright (c) 2007 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -101,8 +101,26 @@
 	           "$allvisbits" "$ebcdicvisbits"
 }
 
+atf_test_case seek
+seek_head() {
+	atf_set "descr" "Tests output file seeking"
+}
+
+seek_body() {
+	echo TEST1234 > testfile
+	atf_check -s exit:0 -e ignore \
+	    dd if=/dev/zero of=testfile seek=1 bs=8k count=1
+	atf_check -s exit:0 -e ignore -o match:'^TEST1234$' dd if=testfile
+
+	echo TEST1234 > tf2
+	atf_check -s exit:0 -e ignore -x \
+	    'dd bs=4 if=/dev/zero count=1 | tr \\0 \\n | dd of=tf2 bs=4 seek=1'
+	atf_check -s exit:0 -e ignore -o match:'^TEST$' dd if=tf2
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case length
 	atf_add_test_case io
+	atf_add_test_case seek
 }

Reply via email to