Module Name:    src
Committed By:   pgoyette
Date:           Fri Jun 17 03:55:35 UTC 2016

Modified Files:
        src/tests/sbin/sysctl: t_perm.sh

Log Message:
When deadbeef is treated as a 32-bit signed integer, it actually has a
negative value.  So, if the value gets written into a sysctl variable,
and then is read back, the twos-complement value is displayed.

So, when checking for the value having been written, make sure we check
for the correct value!


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/sbin/sysctl/t_perm.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/sbin/sysctl/t_perm.sh
diff -u src/tests/sbin/sysctl/t_perm.sh:1.6 src/tests/sbin/sysctl/t_perm.sh:1.7
--- src/tests/sbin/sysctl/t_perm.sh:1.6	Sun Mar 18 09:46:50 2012
+++ src/tests/sbin/sysctl/t_perm.sh	Fri Jun 17 03:55:35 2016
@@ -1,4 +1,4 @@
-# $NetBSD: t_perm.sh,v 1.6 2012/03/18 09:46:50 jruoho Exp $
+# $NetBSD: t_perm.sh,v 1.7 2016/06/17 03:55:35 pgoyette Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -39,6 +39,7 @@ clean() {
 sysctl_write() {
 
 	deadbeef="3735928559"
+	deadbeef_signed="-559038737"
 
 	sysctl $1 | cut -d= -f1 > $file
 
@@ -63,7 +64,7 @@ sysctl_write() {
 	# A functional verification that $deadbeef
 	# was not actually written to the node.
 	#
-	if [ ! -z $(sysctl $1 | grep $deadbeef) ]; then
+	if [ ! -z $(sysctl $1 | grep -e $deadbeef -e $deadbeef_signed) ]; then
 		atf_fail "value was written"
 	fi
 }

Reply via email to