tests: replace deprecated '-s eq:...' with '-s exit:...'

This commit is contained in:
rillig 2024-04-28 07:27:40 +00:00
parent 2a7fd23976
commit d8f5b04c09
46 changed files with 601 additions and 601 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: t_df.sh,v 1.2 2020/08/23 15:51:30 ryo Exp $
# $NetBSD: t_df.sh,v 1.3 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -79,7 +79,7 @@ filer:/ 1202716672 1202716672 -180407500 117% /filer
/dev/strpct 21474836476 10737418240 10737418236 50% /strpct
/dev/wd0e 10485688 2859932 7625756 27% /mount/windows/C
EOF
atf_check -s eq:0 -o file:expout -e empty \
atf_check -s exit:0 -o file:expout -e empty \
-x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df -n"
}
@ -137,7 +137,7 @@ filer:/ 1.1T 1.1T -172G 117% /filer
/dev/strpct 20T 10T 10T 50% /strpct
/dev/wd0e 10G 2.7G 7.3G 27% /mount/windows/C
EOF
atf_check -s eq:0 -o file:expout -e empty \
atf_check -s exit:0 -o file:expout -e empty \
-x "BLOCKSIZE=1k $(atf_get_srcdir)/h_df -hn"
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_pax.sh,v 1.1 2012/03/17 16:33:11 jruoho Exp $
# $NetBSD: t_pax.sh,v 1.2 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,17 +35,17 @@ append_body() {
touch foo bar
# store both foo and bar into file1.tar
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
pax -w -b 512 -x ustar -f file1.tar foo bar
# store foo into file2.tar, then append bar to file2.tar
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
pax -w -b 512 -x ustar -f file2.tar foo
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
pax -w -b 512 -x ustar -f file2.tar -a bar
# ensure that file1.tar and file2.tar are equal
atf_check -s eq:0 -o empty -e empty cmp file1.tar file2.tar
atf_check -s exit:0 -o empty -e empty cmp file1.tar file2.tar
}
atf_init_test_cases()

View File

@ -1,4 +1,4 @@
# $NetBSD: t_ulimit.sh,v 1.3 2016/03/27 14:50:01 christos Exp $
# $NetBSD: t_ulimit.sh,v 1.4 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
@ -45,10 +45,10 @@ get_ulimits() {
}
limits_body() {
atf_check -s eq:0 -o ignore -e empty ${TEST_SH} -c "ulimit -a"
atf_check -s exit:0 -o ignore -e empty ${TEST_SH} -c "ulimit -a"
for l in $(get_ulimits)
do
atf_check -s eq:0 -o ignore -e empty ${TEST_SH} -c "ulimit $l"
atf_check -s exit:0 -o ignore -e empty ${TEST_SH} -c "ulimit $l"
done
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_varquote.sh,v 1.5 2016/03/27 14:50:01 christos Exp $
# $NetBSD: t_varquote.sh,v 1.6 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2007 The NetBSD Foundation, Inc.
# All rights reserved.
@ -113,7 +113,7 @@ nested_quotes_multiword_head() {
"string works (PR bin/43597)"
}
nested_quotes_multiword_body() {
atf_check -s eq:0 -o match:"first-word second-word" -e empty \
atf_check -s exit:0 -o match:"first-word second-word" -e empty \
${TEST_SH} -c 'echo "${foo:="first-word"} second-word"'
}
@ -123,8 +123,8 @@ default_assignment_with_arith_head() {
"string works (PR bin/50827)"
}
default_assignment_with_arith_body() {
atf_check -s eq:0 -o empty -e empty ${TEST_SH} -c ': "${x=$((1))}"'
atf_check -s eq:0 -o match:1 -e empty ${TEST_SH} -c 'echo "${x=$((1))}"'
atf_check -s exit:0 -o empty -e empty ${TEST_SH} -c ': "${x=$((1))}"'
atf_check -s exit:0 -o match:1 -e empty ${TEST_SH} -c 'echo "${x=$((1))}"'
}
atf_init_test_cases() {

View File

@ -1,4 +1,4 @@
# $NetBSD: t_tar.sh,v 1.2 2018/11/30 00:53:41 christos Exp $
# $NetBSD: t_tar.sh,v 1.3 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,14 +35,14 @@ append_body() {
touch foo bar
# store both foo and bar into file1.tar
atf_check -s eq:0 -o empty -e empty tar -cf file1.tar foo bar
atf_check -s exit:0 -o empty -e empty tar -cf file1.tar foo bar
# store foo into file2.tar, then append bar to file2.tar
atf_check -s eq:0 -o empty -e empty tar -cf file2.tar foo
atf_check -s eq:0 -o empty -e empty tar -rf file2.tar bar
atf_check -s exit:0 -o empty -e empty tar -cf file2.tar foo
atf_check -s exit:0 -o empty -e empty tar -rf file2.tar bar
# ensure that file1.tar and file2.tar are equal
atf_check -s eq:0 -o empty -e empty cmp file1.tar file2.tar
atf_check -s exit:0 -o empty -e empty cmp file1.tar file2.tar
}
atf_test_case rd_base256_size
@ -84,10 +84,10 @@ rd_base256_size_body() {
head -c 1450 /dev/zero >> test.tar
# test extracting the test archive
atf_check -s eq:0 -o empty -e empty tar -xf test.tar
atf_check -s exit:0 -o empty -e empty tar -xf test.tar
# ensure that output.bin is equal to reference.bin
atf_check -s eq:0 -o empty -e empty cmp output.bin reference.bin
atf_check -s exit:0 -o empty -e empty cmp output.bin reference.bin
}
atf_init_test_cases()

View File

@ -1,4 +1,4 @@
# $NetBSD: t_libcrypto.sh,v 1.9 2023/05/08 17:46:06 christos Exp $
# $NetBSD: t_libcrypto.sh,v 1.10 2024/04/28 07:27:40 rillig Exp $
#
# Copyright (c) 2008, 2009, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@ -78,7 +78,7 @@ threads_body()
-cert "$s/d_server.pem" \
-ccert "$s/d_client.pem" \
2>&1 | tee out
atf_check -s eq:1 -o empty -e empty grep :error: out
atf_check -s exit:1 -o empty -e empty grep :error: out
fi
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_psshfs.sh,v 1.9 2017/05/24 15:29:51 christos Exp $
# $NetBSD: t_psshfs.sh,v 1.10 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -72,13 +72,13 @@ start_ssh() {
sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
$(atf_get_srcdir)/sshd_config.in >sshd_config || \
atf_fail "Failed to create sshd_config"
atf_check -s eq:0 -o empty -e empty cp /usr/libexec/sftp-server .
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty cp /usr/libexec/sftp-server .
atf_check -s exit:0 -o empty -e empty \
cp $(atf_get_srcdir)/ssh_host_key .
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
cp $(atf_get_srcdir)/ssh_host_key.pub .
atf_check -s eq:0 -o empty -e empty chmod 400 ssh_host_key
atf_check -s eq:0 -o empty -e empty chmod 444 ssh_host_key.pub
atf_check -s exit:0 -o empty -e empty chmod 400 ssh_host_key
atf_check -s exit:0 -o empty -e empty chmod 444 ssh_host_key.pub
/usr/sbin/sshd -e -f ./sshd_config >sshd.log 2>&1 &
while [ ! -f sshd.pid ]; do
@ -87,14 +87,14 @@ start_ssh() {
echo "SSH server started (pid $(cat sshd.pid))"
echo "Setting up SSH client configuration"
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
ssh-keygen -f ssh_user_key -t rsa -b 1024 -N "" -q
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
cp ssh_user_key.pub authorized_keys
echo "[localhost]:10000,[127.0.0.1]:10000,[::1]:10000" \
"$(cat $(atf_get_srcdir)/ssh_host_key.pub)" >known_hosts || \
atf_fail "Failed to create known_hosts"
atf_check -s eq:0 -o empty -e empty chmod 600 authorized_keys
atf_check -s exit:0 -o empty -e empty chmod 600 authorized_keys
sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
$(atf_get_srcdir)/ssh_config.in >ssh_config || \
atf_fail "Failed to create ssh_config"
@ -119,7 +119,7 @@ stop_ssh() {
# Both directories are supposed to live on the current directory.
#
mount_psshfs() {
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
mount -t psshfs -o -F=$(pwd)/ssh_config localhost:$(pwd)/${1} ${2}
}
@ -159,13 +159,13 @@ EOF
mkdir mnt
mount_psshfs root mnt
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
./ne_inodes.sh root/dir root/dir/file1
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
./ne_inodes.sh root/dir root/dir/file2
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
./ne_inodes.sh root/dir/file1 root/dir/file2
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
./ne_inodes.sh root/file3 root/file4
}
inode_nos_cleanup() {
@ -186,11 +186,11 @@ pwd_body() {
mkdir root/dir
mkdir mnt
atf_check -s eq:0 -o save:stdout -e empty \
atf_check -s exit:0 -o save:stdout -e empty \
-x 'echo $(cd mnt && /bin/pwd)/dir'
mv stdout expout
mount_psshfs root mnt
atf_check -s eq:0 -o file:expout -e empty \
atf_check -s exit:0 -o file:expout -e empty \
-x 'cd mnt/dir && ls .. >/dev/null && /bin/pwd'
}
pwd_cleanup() {

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: h_funcs.subr,v 1.5 2013/03/17 01:16:45 jmmv Exp $
# $NetBSD: h_funcs.subr,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
# All rights reserved.
@ -40,7 +40,7 @@ test_mount() {
require_fs tmpfs
Mount_Point=$(pwd)/mntpt
atf_check -s eq:0 -o empty -e empty mkdir "${Mount_Point}"
atf_check -s exit:0 -o empty -e empty mkdir "${Mount_Point}"
echo "mount -t tmpfs ${*} tmpfs ${Mount_Point}"
mount -t tmpfs "${@}" tmpfs "${Mount_Point}" 2>mounterr
if [ "${?}" -ne 0 ]; then
@ -60,8 +60,8 @@ test_mount() {
#
test_unmount() {
cd - >/dev/null
atf_check -s eq:0 -o empty -e empty umount ${Mount_Point}
atf_check -s eq:0 -o empty -e empty rmdir ${Mount_Point}
atf_check -s exit:0 -o empty -e empty umount ${Mount_Point}
atf_check -s exit:0 -o empty -e empty rmdir ${Mount_Point}
Mount_Point=
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_create.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
# $NetBSD: t_create.sh,v 1.9 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,9 +37,9 @@ create_head() {
create_body() {
test_mount
atf_check -s eq:1 -o empty -e empty test -f a
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty test -f a
atf_check -s exit:1 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty test -f a
test_unmount
}
@ -59,9 +59,9 @@ attrs_body() {
test_mount
umask 022
atf_check -s eq:1 -o empty -e empty test -f a
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty test -f a
atf_check -s exit:1 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty test -f a
eval $(stat -s . | sed -e 's|st_|dst_|g')
eval $(stat -s a)
@ -71,24 +71,24 @@ attrs_body() {
test ${st_gid} -eq ${dst_gid} || atf_fail "Incorrect gid"
test ${st_mode} = 0100644 || atf_fail "Incorrect mode"
atf_check -s eq:0 -o empty -e empty mkdir b c
atf_check -s exit:0 -o empty -e empty mkdir b c
atf_check -s eq:0 -o empty -e empty chown ${user}:0 b
atf_check -s exit:0 -o empty -e empty chown ${user}:0 b
eval $(stat -s b)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty chown ${user}:100 c
atf_check -s exit:0 -o empty -e empty chown ${user}:100 c
eval $(stat -s c)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch b/a'
atf_check -s exit:0 -o empty -e empty su -m ${user} -c 'touch b/a'
eval $(stat -s b/a)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'touch c/a'
atf_check -s exit:0 -o empty -e empty su -m ${user} -c 'touch c/a'
eval $(stat -s c/a)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
@ -105,7 +105,7 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'touch dir/a' | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE

View File

@ -1,4 +1,4 @@
# $NetBSD: t_devices.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_devices.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,12 +35,12 @@ basic_body() {
umask 022
atf_check -s eq:0 -o ignore -e ignore /dev/MAKEDEV std
atf_check -s eq:0 -o empty -e empty test -e zero
atf_check -s eq:0 -o empty -e empty test -e null
atf_check -s exit:0 -o ignore -e ignore /dev/MAKEDEV std
atf_check -s exit:0 -o empty -e empty test -e zero
atf_check -s exit:0 -o empty -e empty test -e null
echo "Reading from the 'zero' character device"
atf_check -s eq:0 -o ignore -e ignore dd if=zero of=a bs=10k count=1
atf_check -s exit:0 -o ignore -e ignore dd if=zero of=a bs=10k count=1
[ $(md5 a | cut -d ' ' -f 4) = 1276481102f218c981e0324180bafd9f ] || \
atf_fail "Data read is invalid"

View File

@ -1,4 +1,4 @@
# $NetBSD: t_dots.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_dots.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -34,9 +34,9 @@ topdir_head() {
topdir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty test -d ./a
atf_check -s eq:0 -o empty -e empty test -d a/../a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty test -d ./a
atf_check -s exit:0 -o empty -e empty test -d a/../a
test_unmount
}
@ -50,10 +50,10 @@ nesteddir_head() {
nesteddir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir a/b
atf_check -s eq:0 -o empty -e empty test -d a/b/../b
atf_check -s eq:0 -o empty -e empty test -d a/b/../../a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a/b
atf_check -s exit:0 -o empty -e empty test -d a/b/../b
atf_check -s exit:0 -o empty -e empty test -d a/b/../../a
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_exec.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_exec.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,11 +35,11 @@ basic_head() {
basic_body() {
test_mount
atf_check -s eq:0 -o empty -e empty cp /bin/cp .
atf_check -s exit:0 -o empty -e empty cp /bin/cp .
echo "Verifying copied file"
[ $(md5 cp | cut -d ' ' -f 4) = $(md5 /bin/cp | cut -d ' ' -f 4) ] || \
atf_file "New binary file does not match original"
atf_check -s eq:0 -o empty -e empty ./cp cp foo
atf_check -s exit:0 -o empty -e empty ./cp cp foo
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_link.sh,v 1.6 2021/10/30 09:53:47 hannken Exp $
# $NetBSD: t_link.sh,v 1.7 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,14 +38,14 @@ basic_head() {
basic_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty touch z
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty touch z
eval $(stat -s a | sed -e 's|st_|sta_|g')
eval $(stat -s z | sed -e 's|st_|stz_|g')
test ${sta_ino} != ${stz_ino} || \
atf_fail "Node numbers are not different"
test ${sta_nlink} -eq 1 || atf_fail "Number of links is incorrect"
atf_check -s eq:0 -o empty -e empty ln a b
atf_check -s exit:0 -o empty -e empty ln a b
echo "Checking if link count is correct after links are created"
eval $(stat -s a | sed -e 's|st_|sta_|g')
@ -55,10 +55,10 @@ basic_body() {
test ${stb_nlink} -eq 2 || atf_fail "Link count is incorrect"
echo "Checking if link count is correct after links are deleted"
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty rm a
eval $(stat -s b | sed -e 's|st_|stb_|g')
test ${stb_nlink} -eq 1 || atf_fail "Link count is incorrect"
atf_check -s eq:0 -o empty -e empty rm b
atf_check -s exit:0 -o empty -e empty rm b
test_unmount
}
@ -72,9 +72,9 @@ subdirs_head() {
subdirs_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty mkdir c
atf_check -s eq:0 -o empty -e empty ln a c/b
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty mkdir c
atf_check -s exit:0 -o empty -e empty ln a c/b
echo "Checking if link count is correct after links are created"
eval $(stat -s a | sed -e 's|st_|sta_|g')
@ -84,11 +84,11 @@ subdirs_body() {
test ${stb_nlink} -eq 2 || atf_fail "Link count is incorrect"
echo "Checking if link count is correct after links are deleted"
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty rm a
eval $(stat -s c/b | sed -e 's|st_|stb_|g')
test ${stb_nlink} -eq 1 || atf_fail "Link count is incorrect"
atf_check -s eq:0 -o empty -e empty rm c/b
atf_check -s eq:0 -o empty -e empty rmdir c
atf_check -s exit:0 -o empty -e empty rm c/b
atf_check -s exit:0 -o empty -e empty rmdir c
test_unmount
}
@ -102,8 +102,8 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty touch dir/a
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty touch dir/a
echo 'ln dir/a dir/b' | kqueue_monitor 2 dir dir/a
kqueue_check dir/a NOTE_LINK
kqueue_check dir NOTE_WRITE
@ -111,8 +111,8 @@ kqueue_body() {
echo 'rm dir/a' | kqueue_monitor 2 dir dir/b
kqueue_check dir/b NOTE_DELETE
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rm dir/b
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rm dir/b
atf_check -s exit:0 -o empty -e empty rmdir dir
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_mkdir.sh,v 1.8 2011/03/05 07:41:11 pooka Exp $
# $NetBSD: t_mkdir.sh,v 1.9 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -39,9 +39,9 @@ single_head() {
single_body() {
test_mount
atf_check -s eq:1 -o empty -e empty test -d a
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty test -d a
atf_check -s exit:1 -o empty -e empty test -d a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty test -d a
test -d a
eval $(stat -s ${Mount_Point})
[ ${st_nlink} = 3 ] || atf_fail "Link count is not 3"
@ -59,9 +59,9 @@ many_body() {
test_mount
for d in $(jot 100); do
atf_check -s eq:1 -o empty -e empty test -d ${d}
atf_check -s eq:0 -o empty -e empty mkdir ${d}
atf_check -s eq:0 -o empty -e empty test -d ${d}
atf_check -s exit:1 -o empty -e empty test -d ${d}
atf_check -s exit:0 -o empty -e empty mkdir ${d}
atf_check -s exit:0 -o empty -e empty test -d ${d}
done
eval $(stat -s ${Mount_Point})
[ ${st_nlink} = 102 ] || atf_fail "Link count is not 102"
@ -77,9 +77,9 @@ nested_head() {
nested_body() {
test_mount
atf_check -s eq:1 -o empty -e empty test -d a/b/c/d/e
atf_check -s eq:0 -o empty -e empty mkdir -p a/b/c/d/e
atf_check -s eq:0 -o empty -e empty test -d a/b/c/d/e
atf_check -s exit:1 -o empty -e empty test -d a/b/c/d/e
atf_check -s exit:0 -o empty -e empty mkdir -p a/b/c/d/e
atf_check -s exit:0 -o empty -e empty test -d a/b/c/d/e
test_unmount
}
@ -98,24 +98,24 @@ attrs_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir b c
atf_check -s exit:0 -o empty -e empty mkdir b c
atf_check -s eq:0 -o empty -e empty chown ${user}:0 b
atf_check -s exit:0 -o empty -e empty chown ${user}:0 b
eval $(stat -s b)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty chown ${user}:100 c
atf_check -s exit:0 -o empty -e empty chown ${user}:100 c
eval $(stat -s c)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'mkdir b/a'
atf_check -s exit:0 -o empty -e empty su -m ${user} -c 'mkdir b/a'
eval $(stat -s b/a)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 0 ] || atf_fail "Incorrect group"
atf_check -s eq:0 -o empty -e empty su -m ${user} -c 'mkdir c/a'
atf_check -s exit:0 -o empty -e empty su -m ${user} -c 'mkdir c/a'
eval $(stat -s c/a)
[ ${st_uid} -eq $(id -u ${user}) ] || atf_fail "Incorrect owner"
[ ${st_gid} -eq 100 ] || atf_fail "Incorrect group"
@ -132,7 +132,7 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'mkdir dir/a' | kqueue_monitor 2 dir
# Creating a directory raises NOTE_LINK on the parent directory
@ -141,8 +141,8 @@ kqueue_body() {
# Creating a directory raises NOTE_WRITE on the parent directory
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rmdir dir/a
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rmdir dir/a
atf_check -s exit:0 -o empty -e empty rmdir dir
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_mknod.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_mknod.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,7 +38,7 @@ block_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mknod fd0a b 2 0
atf_check -s exit:0 -o empty -e empty mknod fd0a b 2 0
eval $(stat -s fd0a)
[ ${st_mode} = 060644 ] || atf_fail "Invalid mode"
[ ${st_rdev} -eq 512 ] || atf_fail "Invalid device"
@ -56,7 +56,7 @@ block_kqueue_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'mknod dir/fd0a b 2 0' | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE
@ -72,7 +72,7 @@ char_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mknod null c 2 2
atf_check -s exit:0 -o empty -e empty mknod null c 2 2
eval $(stat -s null)
[ ${st_mode} = 020644 ] || atf_fail "Invalid mode"
[ ${st_rdev} -eq 514 ] || atf_fail "Invalid device"
@ -90,7 +90,7 @@ char_kqueue_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'mknod dir/null c 2 2' | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE
@ -106,7 +106,7 @@ pipe_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mknod pipe p
atf_check -s exit:0 -o empty -e empty mknod pipe p
eval $(stat -s pipe)
[ ${st_mode} = 010644 ] || atf_fail "Invalid mode"
@ -123,7 +123,7 @@ pipe_kqueue_body() {
test_mount
umask 022
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'mknod dir/pipe p' | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE

View File

@ -1,4 +1,4 @@
# $NetBSD: t_mount.sh,v 1.6 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_mount.sh,v 1.7 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -104,9 +104,9 @@ large_body() {
test_unmount
mkdir tmp
atf_check -s eq:1 -o empty -e ignore \
atf_check -s exit:1 -o empty -e ignore \
mount -t tmpfs -o -s9223372036854775808 tmpfs tmp
atf_check -s eq:1 -o empty -e ignore \
atf_check -s exit:1 -o empty -e ignore \
mount -t tmpfs -o -s9223372036854775808g tmpfs tmp
rmdir tmp
}
@ -119,12 +119,12 @@ mntpt_head() {
}
mntpt_body() {
mount_tmpfs unused $(pwd)/mnt >out 2>&1
atf_check -s eq:1 -o empty -e empty grep unused out
atf_check -s eq:0 -o ignore -e empty grep "$(pwd)/mnt" out
atf_check -s exit:1 -o empty -e empty grep unused out
atf_check -s exit:0 -o ignore -e empty grep "$(pwd)/mnt" out
mount_tmpfs unused mnt >out 2>&1
atf_check -s eq:1 -o empty -e empty grep unused out
atf_check -s eq:0 -o ignore -e empty grep mnt out
atf_check -s exit:1 -o empty -e empty grep unused out
atf_check -s exit:0 -o ignore -e empty grep mnt out
}
atf_init_test_cases() {

View File

@ -1,4 +1,4 @@
# $NetBSD: t_pipes.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_pipes.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,7 +35,7 @@ basic_body() {
umask 022
atf_check -s eq:0 -o empty -e empty mknod pipe p
atf_check -s exit:0 -o empty -e empty mknod pipe p
echo "Writing to pipe and waiting for response"
echo -n foo >pipe &

View File

@ -1,4 +1,4 @@
# $NetBSD: t_read_write.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_read_write.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -64,7 +64,7 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
dd if=/dev/zero of=c bs=1k count=10
echo 'dd if=/dev/zero of=c seek=2 bs=1k count=1 conv=notrunc' \
'>/dev/null 2>&1' | kqueue_monitor 1 c

View File

@ -1,4 +1,4 @@
# $NetBSD: t_readdir.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_readdir.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,9 +38,9 @@ dots_head() {
dots_body() {
test_mount
atf_check -s eq:0 -o save:stdout -e empty /bin/ls -a
atf_check -s eq:0 -o ignore -e empty grep '^\.$' stdout
atf_check -s eq:0 -o ignore -e empty grep '^\..$' stdout
atf_check -s exit:0 -o save:stdout -e empty /bin/ls -a
atf_check -s exit:0 -o ignore -e empty grep '^\.$' stdout
atf_check -s exit:0 -o ignore -e empty grep '^\..$' stdout
test_unmount
}
@ -54,17 +54,17 @@ types_head() {
types_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty touch reg
atf_check -s eq:0 -o empty -e empty ln -s reg lnk
atf_check -s eq:0 -o empty -e empty mknod blk b 0 0
atf_check -s eq:0 -o empty -e empty mknod chr c 0 0
atf_check -s eq:0 -o empty -e empty mknod fifo p
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty touch reg
atf_check -s exit:0 -o empty -e empty ln -s reg lnk
atf_check -s exit:0 -o empty -e empty mknod blk b 0 0
atf_check -s exit:0 -o empty -e empty mknod chr c 0 0
atf_check -s exit:0 -o empty -e empty mknod fifo p
atf_check -s exit:0 -o empty -e empty \
$(atf_get_srcdir)/h_tools sockets sock
atf_check -s eq:0 -o ignore -e empty ls
atf_check -s eq:0 -o empty -e empty rm -rf *
atf_check -s exit:0 -o ignore -e empty ls
atf_check -s exit:0 -o empty -e empty rm -rf *
test_unmount
}
@ -78,10 +78,10 @@ caching_head() {
caching_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch $(jot 10)
atf_check -s eq:0 -o empty -e empty rm *
atf_check -s eq:0 -o empty -e empty touch $(jot 20)
atf_check -s eq:0 -o empty -e empty -x "ls >/dev/null"
atf_check -s exit:0 -o empty -e empty touch $(jot 10)
atf_check -s exit:0 -o empty -e empty rm *
atf_check -s exit:0 -o empty -e empty touch $(jot 20)
atf_check -s exit:0 -o empty -e empty -x "ls >/dev/null"
test_unmount
}
@ -94,13 +94,13 @@ many_head() {
many_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a
echo "Creating 500 files"
for f in $(jot 500); do
touch a/$f
done
atf_check -s eq:0 -o empty -e empty rm a/*
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty rm a/*
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_remove.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_remove.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,11 +37,11 @@ single_head() {
single_body() {
test_mount
atf_check -s eq:1 -o empty -e empty test -f a
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty test -f a
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s eq:1 -o empty -e empty test -f a
atf_check -s exit:1 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty rm a
atf_check -s exit:1 -o empty -e empty test -f a
test_unmount
}
@ -55,12 +55,12 @@ uchg_head() {
uchg_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty chflags uchg a
atf_check -s eq:1 -o empty -e ignore rm -f a
atf_check -s eq:0 -o empty -e empty chflags nouchg a
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s eq:1 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty chflags uchg a
atf_check -s exit:1 -o empty -e ignore rm -f a
atf_check -s exit:0 -o empty -e empty chflags nouchg a
atf_check -s exit:0 -o empty -e empty rm a
atf_check -s exit:1 -o empty -e empty test -f a
test_unmount
}
@ -73,9 +73,9 @@ dot_head() {
dot_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:1 -o empty -e ignore unlink a/.
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:1 -o empty -e ignore unlink a/.
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -89,12 +89,12 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty touch dir/a
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty touch dir/a
echo 'rm dir/a' | kqueue_monitor 2 dir dir/a
kqueue_check dir/a NOTE_DELETE
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rmdir dir
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_rename.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_rename.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,10 +38,10 @@ dots_head() {
dots_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:1 -o empty -e ignore mv a/. c
atf_check -s eq:1 -o empty -e ignore mv a/.. c
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:1 -o empty -e ignore mv a/. c
atf_check -s exit:1 -o empty -e ignore mv a/.. c
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -54,12 +54,12 @@ crossdev_head() {
crossdev_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:1 -o empty -e save:stderr \
$(atf_get_srcdir)/h_tools rename a /var/tmp/a
atf_check -s eq:0 -o ignore -e empty grep "Cross-device link" stderr
atf_check -s eq:0 -o empty -e empty test -d a
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o ignore -e empty grep "Cross-device link" stderr
atf_check -s exit:0 -o empty -e empty test -d a
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -72,11 +72,11 @@ basic_head() {
basic_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mv a c
atf_check -s eq:1 -o empty -e empty test -d a
atf_check -s eq:0 -o empty -e empty test -d c
atf_check -s eq:0 -o empty -e empty rmdir c
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mv a c
atf_check -s exit:1 -o empty -e empty test -d a
atf_check -s exit:0 -o empty -e empty test -d c
atf_check -s exit:0 -o empty -e empty rmdir c
test_unmount
}
@ -91,37 +91,37 @@ dotdot_body() {
test_mount
echo "Checking if the '..' entry is updated after moves"
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:0 -o empty -e empty mv b a
atf_check -s eq:0 -o empty -e empty test -d a/b/../b
atf_check -s eq:0 -o empty -e empty test -d a/b/../../a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:0 -o empty -e empty mv b a
atf_check -s exit:0 -o empty -e empty test -d a/b/../b
atf_check -s exit:0 -o empty -e empty test -d a/b/../../a
eval $(stat -s a/b)
[ ${st_nlink} = 2 ] || atf_fail "Incorrect number of links"
eval $(stat -s a)
[ ${st_nlink} = 3 ] || atf_fail "Incorrect number of links"
atf_check -s eq:0 -o empty -e empty rmdir a/b
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty rmdir a/b
atf_check -s exit:0 -o empty -e empty rmdir a
echo "Checking if the '..' entry is correct after renames"
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:0 -o empty -e empty mv b a
atf_check -s eq:0 -o empty -e empty mv a c
atf_check -s eq:0 -o empty -e empty test -d c/b/../b
atf_check -s eq:0 -o empty -e empty test -d c/b/../../c
atf_check -s eq:0 -o empty -e empty rmdir c/b
atf_check -s eq:0 -o empty -e empty rmdir c
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:0 -o empty -e empty mv b a
atf_check -s exit:0 -o empty -e empty mv a c
atf_check -s exit:0 -o empty -e empty test -d c/b/../b
atf_check -s exit:0 -o empty -e empty test -d c/b/../../c
atf_check -s exit:0 -o empty -e empty rmdir c/b
atf_check -s exit:0 -o empty -e empty rmdir c
echo "Checking if the '..' entry is correct after multiple moves"
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:0 -o empty -e empty mv b a
atf_check -s eq:0 -o empty -e empty mv a c
atf_check -s eq:0 -o empty -e empty mv c/b d
atf_check -s eq:0 -o empty -e empty test -d d/../c
atf_check -s eq:0 -o empty -e empty rmdir d
atf_check -s eq:0 -o empty -e empty rmdir c
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:0 -o empty -e empty mv b a
atf_check -s exit:0 -o empty -e empty mv a c
atf_check -s exit:0 -o empty -e empty mv c/b d
atf_check -s exit:0 -o empty -e empty test -d d/../c
atf_check -s exit:0 -o empty -e empty rmdir d
atf_check -s exit:0 -o empty -e empty rmdir c
test_unmount
}
@ -135,14 +135,14 @@ dir_to_emptydir_head() {
dir_to_emptydir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty touch a/c
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty touch a/c
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:0 -o empty -e empty \
$(atf_get_srcdir)/h_tools rename a b
atf_check -s eq:1 -o empty -e empty test -e a
atf_check -s eq:0 -o empty -e empty test -d b
atf_check -s eq:0 -o empty -e empty test -f b/c
atf_check -s exit:1 -o empty -e empty test -e a
atf_check -s exit:0 -o empty -e empty test -d b
atf_check -s exit:0 -o empty -e empty test -f b/c
rm b/c
rmdir b
@ -158,17 +158,17 @@ dir_to_fulldir_head() {
dir_to_fulldir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty touch a/c
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:0 -o empty -e empty touch b/d
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty touch a/c
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:0 -o empty -e empty touch b/d
atf_check -s exit:1 -o empty -e save:stderr \
$(atf_get_srcdir)/h_tools rename a b
atf_check -s eq:0 -o ignore -e empty grep "Directory not empty" stderr
atf_check -s eq:0 -o empty -e empty test -d a
atf_check -s eq:0 -o empty -e empty test -f a/c
atf_check -s eq:0 -o empty -e empty test -d b
atf_check -s eq:0 -o empty -e empty test -f b/d
atf_check -s exit:0 -o ignore -e empty grep "Directory not empty" stderr
atf_check -s exit:0 -o empty -e empty test -d a
atf_check -s exit:0 -o empty -e empty test -f a/c
atf_check -s exit:0 -o empty -e empty test -d b
atf_check -s exit:0 -o empty -e empty test -f b/d
rm a/c
rm b/d
rmdir a
@ -186,13 +186,13 @@ dir_to_file_head() {
dir_to_file_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty touch b
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty touch b
atf_check -s exit:1 -o empty -e save:stderr \
$(atf_get_srcdir)/h_tools rename a b
atf_check -s eq:0 -o ignore -e empty grep "Not a directory" stderr
atf_check -s eq:0 -o empty -e empty test -d a
atf_check -s eq:0 -o empty -e empty test -f b
atf_check -s exit:0 -o ignore -e empty grep "Not a directory" stderr
atf_check -s exit:0 -o empty -e empty test -d a
atf_check -s exit:0 -o empty -e empty test -f b
rmdir a
rm b
@ -208,13 +208,13 @@ file_to_dir_head() {
file_to_dir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty mkdir b
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty mkdir b
atf_check -s exit:1 -o empty -e save:stderr \
$(atf_get_srcdir)/h_tools rename a b
atf_check -s eq:0 -o ignore -e empty grep "Is a directory" stderr
atf_check -s eq:0 -o empty -e empty test -f a
atf_check -s eq:0 -o empty -e empty test -d b
atf_check -s exit:0 -o ignore -e empty grep "Is a directory" stderr
atf_check -s exit:0 -o empty -e empty test -f a
atf_check -s exit:0 -o empty -e empty test -d b
rm a
rmdir b
@ -230,34 +230,34 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty touch dir/a
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty touch dir/a
echo 'mv dir/a dir/b' | kqueue_monitor 2 dir dir/a
kqueue_check dir/a NOTE_RENAME
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rm dir/b
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rm dir/b
atf_check -s exit:0 -o empty -e empty rmdir dir
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty touch dir/a
atf_check -s eq:0 -o empty -e empty touch dir/b
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty touch dir/a
atf_check -s exit:0 -o empty -e empty touch dir/b
echo 'mv dir/a dir/b' | kqueue_monitor 3 dir dir/a dir/b
kqueue_check dir/a NOTE_RENAME
kqueue_check dir NOTE_WRITE
kqueue_check dir/b NOTE_DELETE
atf_check -s eq:0 -o empty -e empty rm dir/b
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rm dir/b
atf_check -s exit:0 -o empty -e empty rmdir dir
atf_check -s eq:0 -o empty -e empty mkdir dir1
atf_check -s eq:0 -o empty -e empty mkdir dir2
atf_check -s eq:0 -o empty -e empty touch dir1/a
atf_check -s exit:0 -o empty -e empty mkdir dir1
atf_check -s exit:0 -o empty -e empty mkdir dir2
atf_check -s exit:0 -o empty -e empty touch dir1/a
echo 'mv dir1/a dir2/a' | kqueue_monitor 3 dir1 dir1/a dir2
kqueue_check dir1/a NOTE_RENAME
kqueue_check dir1 NOTE_WRITE
kqueue_check dir2 NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rm dir2/a
atf_check -s eq:0 -o empty -e empty rmdir dir1
atf_check -s eq:0 -o empty -e empty rmdir dir2
atf_check -s exit:0 -o empty -e empty rm dir2/a
atf_check -s exit:0 -o empty -e empty rmdir dir1
atf_check -s exit:0 -o empty -e empty rmdir dir2
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_rmdir.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_rmdir.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,7 +38,7 @@ mntpt_head() {
mntpt_body() {
test_mount
atf_check -s eq:1 -o empty -e ignore rmdir ${Mount_Point}
atf_check -s exit:1 -o empty -e ignore rmdir ${Mount_Point}
test_unmount
}
@ -52,7 +52,7 @@ non_existent_head() {
non_existent_body() {
test_mount
atf_check -s eq:1 -o empty -e ignore rmdir non-existent
atf_check -s exit:1 -o empty -e ignore rmdir non-existent
test_unmount
}
@ -65,11 +65,11 @@ single_head() {
single_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a
eval $(stat -s ${Mount_Point})
[ ${st_nlink} = 3 ] || \
atf_fail "Incorrect number of links after creation"
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty rmdir a
eval $(stat -s ${Mount_Point})
[ ${st_nlink} = 2 ] || \
atf_fail "Incorrect number of links after removal"
@ -85,10 +85,10 @@ nested_head() {
nested_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir -p a/b/c
atf_check -s eq:0 -o empty -e empty rmdir a/b/c
atf_check -s eq:0 -o empty -e empty rmdir a/b
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty mkdir -p a/b/c
atf_check -s exit:0 -o empty -e empty rmdir a/b/c
atf_check -s exit:0 -o empty -e empty rmdir a/b
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -101,10 +101,10 @@ dots_head() {
dots_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:1 -o empty -e ignore rmdir a/.
atf_check -s eq:1 -o empty -e ignore rmdir a/..
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:1 -o empty -e ignore rmdir a/.
atf_check -s exit:1 -o empty -e ignore rmdir a/..
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -117,13 +117,13 @@ non_empty_head() {
non_empty_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir a/b
atf_check -s eq:0 -o empty -e empty mkdir a/c
atf_check -s eq:1 -o empty -e ignore rmdir a
atf_check -s eq:0 -o empty -e empty rmdir a/b
atf_check -s eq:0 -o empty -e empty rmdir a/c
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a/b
atf_check -s exit:0 -o empty -e empty mkdir a/c
atf_check -s exit:1 -o empty -e ignore rmdir a
atf_check -s exit:0 -o empty -e empty rmdir a/b
atf_check -s exit:0 -o empty -e empty rmdir a/c
atf_check -s exit:0 -o empty -e empty rmdir a
test_unmount
}
@ -136,13 +136,13 @@ links_head() {
links_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s eq:0 -o empty -e empty mkdir a/b
atf_check -s eq:0 -o empty -e empty mkdir c
atf_check -s exit:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a/b
atf_check -s exit:0 -o empty -e empty mkdir c
atf_check -s eq:0 -o empty -e empty rmdir c
atf_check -s eq:0 -o empty -e empty rmdir a/b
atf_check -s eq:0 -o empty -e empty rmdir a
atf_check -s exit:0 -o empty -e empty rmdir c
atf_check -s exit:0 -o empty -e empty rmdir a/b
atf_check -s exit:0 -o empty -e empty rmdir a
eval $(stat -s ${Mount_Point})
[ ${st_nlink} = 2 ] || atf_fail "Incorrect number of links"
@ -158,12 +158,12 @@ curdir_head() {
curdir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a
atf_check -s exit:0 -o empty -e empty mkdir a
# Catch a bug that would panic the system when accessing the
# current directory after being deleted: vop_open cannot assume
# that open files are still linked to a directory.
atf_check -s eq:1 -o empty -e ignore -x '( cd a && rmdir ../a && ls )'
atf_check -s eq:1 -o empty -e empty test -e a
atf_check -s exit:1 -o empty -e ignore -x '( cd a && rmdir ../a && ls )'
atf_check -s exit:1 -o empty -e empty test -e a
test_unmount
}
@ -177,13 +177,13 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s eq:0 -o empty -e empty mkdir dir/a
atf_check -s exit:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir/a
echo 'rmdir dir/a' | kqueue_monitor 3 dir dir/a
kqueue_check dir/a NOTE_DELETE
kqueue_check dir NOTE_LINK
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rmdir dir
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_setattr.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_setattr.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,9 +38,9 @@ chown_head() {
chown_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir own
atf_check -s exit:0 -o empty -e empty mkdir own
eval $(stat -s own | sed -e 's|st_|ost_|g')
atf_check -s eq:0 -o empty -e empty chown 1234 own
atf_check -s exit:0 -o empty -e empty chown 1234 own
eval $(stat -s own)
[ ${st_uid} -eq 1234 ] || atf_fail "uid was not set"
[ ${st_gid} -eq ${ost_gid} ] || atf_fail "gid was modified"
@ -57,7 +57,7 @@ chown_kqueue_head() {
chown_kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir ownq
atf_check -s exit:0 -o empty -e empty mkdir ownq
echo 'chown 1234 ownq' | kqueue_monitor 1 ownq
kqueue_check ownq NOTE_ATTRIB
@ -72,9 +72,9 @@ chgrp_head() {
chgrp_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir grp
atf_check -s exit:0 -o empty -e empty mkdir grp
eval $(stat -s grp | sed -e 's|st_|ost_|g')
atf_check -s eq:0 -o empty -e empty chgrp 5678 grp
atf_check -s exit:0 -o empty -e empty chgrp 5678 grp
eval $(stat -s grp)
[ ${st_uid} -eq ${ost_uid} ] || atf_fail "uid was modified"
[ ${st_gid} -eq 5678 ] || atf_fail "gid was not set"
@ -91,7 +91,7 @@ chgrp_kqueue_head() {
chgrp_kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir grpq
atf_check -s exit:0 -o empty -e empty mkdir grpq
echo 'chgrp 1234 grpq' | kqueue_monitor 1 grpq
kqueue_check grpq NOTE_ATTRIB
@ -107,8 +107,8 @@ chowngrp_head() {
chowngrp_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir owngrp
atf_check -s eq:0 -o empty -e empty chown 1234:5678 owngrp
atf_check -s exit:0 -o empty -e empty mkdir owngrp
atf_check -s exit:0 -o empty -e empty chown 1234:5678 owngrp
eval $(stat -s owngrp)
[ ${st_uid} -eq 1234 ] || atf_fail "uid was not modified"
[ ${st_gid} -eq 5678 ] || atf_fail "gid was not modified"
@ -125,7 +125,7 @@ chowngrp_kqueue_head() {
chowngrp_kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir owngrpp
atf_check -s exit:0 -o empty -e empty mkdir owngrpp
echo 'chown 1234:5678 owngrpp' | kqueue_monitor 1 owngrpp
kqueue_check owngrpp NOTE_ATTRIB
@ -140,8 +140,8 @@ chmod_head() {
chmod_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir mode
atf_check -s eq:0 -o empty -e empty chmod 0000 mode
atf_check -s exit:0 -o empty -e empty mkdir mode
atf_check -s exit:0 -o empty -e empty chmod 0000 mode
eval $(stat -s mode)
[ ${st_mode} -eq 40000 ] || af_fail "mode was not set"
@ -157,7 +157,7 @@ chmod_kqueue_head() {
chmod_kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir modeq
atf_check -s exit:0 -o empty -e empty mkdir modeq
echo 'chmod 0000 modeq' | kqueue_monitor 1 modeq
kqueue_check modeq NOTE_ATTRIB
@ -172,8 +172,8 @@ chtimes_head() {
chtimes_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir times
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty mkdir times
atf_check -s exit:0 -o empty -e empty \
-x 'TZ=GMT touch -t 200501010101 times'
eval $(stat -s times)
[ ${st_atime} = ${st_mtime} ] || \
@ -192,7 +192,7 @@ chtimes_kqueue_head() {
chtimes_kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir timesq
atf_check -s exit:0 -o empty -e empty mkdir timesq
echo 'touch timesq' | kqueue_monitor 1 timesq
kqueue_check timesq NOTE_ATTRIB

View File

@ -1,4 +1,4 @@
# $NetBSD: t_sizes.sh,v 1.6 2018/01/17 00:23:17 maya Exp $
# $NetBSD: t_sizes.sh,v 1.7 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -41,7 +41,7 @@ small_body() {
eval $($(atf_get_srcdir)/h_tools statvfs .)
f_bused=$((${f_blocks} - ${f_bfree}))
[ ${f_bused} -gt 1 ] || atf_fail "Incorrect bused count"
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty rm a
test_unmount
}
@ -58,7 +58,7 @@ big_body() {
eval $($(atf_get_srcdir)/h_tools statvfs . | sed -e 's|^f_|cf_|')
cf_bused=$((${cf_blocks} - ${cf_bfree}))
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
dd if=/dev/zero of=a bs=1m count=5
eval $($(atf_get_srcdir)/h_tools statvfs .)
f_bused=$((${f_blocks} - ${f_bfree}))
@ -66,7 +66,7 @@ big_body() {
[ ${f_bused} -gt $((5 * 1024 * 1024 / ${pagesize})) ] || \
atf_fail "bused too big"
of_bused=${f_bused}
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty rm a
eval $($(atf_get_srcdir)/h_tools statvfs .)
f_bused=$((${f_blocks} - ${f_bfree}))
[ ${f_bused} -lt ${of_bused} ] || \
@ -84,13 +84,13 @@ overflow_head() {
overflow_body() {
test_mount -o -s10M
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty rm a
eval $($(atf_get_srcdir)/h_tools statvfs .)
of_bused=$((${f_blocks} - ${f_bfree}))
atf_check -s eq:1 -o ignore -e ignore \
atf_check -s exit:1 -o ignore -e ignore \
dd if=/dev/zero of=a bs=1m count=15
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty rm a
eval $($(atf_get_srcdir)/h_tools statvfs .)
f_bused=$((${f_blocks} - ${f_bfree}))
[ ${f_bused} -ge ${of_bused} -a ${f_bused} -le $((${of_bused} + 1)) ] \
@ -108,10 +108,10 @@ overwrite_head() {
overwrite_body() {
test_mount -o -s10M
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
dd if=/dev/zero of=a bs=1024 count=10
sync
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
dd if=/dev/zero of=a bs=1024 conv=notrunc seek=1 count=1
sync
eval $(stat -s a)

View File

@ -1,4 +1,4 @@
# $NetBSD: t_sockets.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_sockets.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -34,10 +34,10 @@ basic_head() {
basic_body() {
test_mount
atf_check -s eq:0 -o empty -e empty $(atf_get_srcdir)/h_tools sockets a
atf_check -s eq:0 -o empty -e empty rm a
atf_check -s exit:0 -o empty -e empty $(atf_get_srcdir)/h_tools sockets a
atf_check -s exit:0 -o empty -e empty rm a
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo "$(atf_get_srcdir)/h_tools sockets dir/a" | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE

View File

@ -1,4 +1,4 @@
# $NetBSD: t_symlink.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_symlink.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,12 +37,12 @@ file_head() {
file_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s eq:0 -o empty -e empty ln -s a b
atf_check -s exit:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty ln -s a b
[ $(md5 b | cut -d ' ' -f 4) = d41d8cd98f00b204e9800998ecf8427e ] || \
atf_fail "Symlink points to an incorrect file"
atf_check -s eq:0 -o empty -e empty -x 'echo foo >a'
atf_check -s exit:0 -o empty -e empty -x 'echo foo >a'
[ $(md5 b | cut -d ' ' -f 4) = d3b07384d113edec49eaa6238ad5ff00 ] || \
atf_fail "Symlink points to an incorrect file"
@ -58,10 +58,10 @@ exec_head() {
exec_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch b
atf_check -s eq:0 -o empty -e empty ln -s /bin/cp cp
atf_check -s eq:0 -o empty -e empty ./cp b c
atf_check -s eq:0 -o empty -e empty test -f c
atf_check -s exit:0 -o empty -e empty touch b
atf_check -s exit:0 -o empty -e empty ln -s /bin/cp cp
atf_check -s exit:0 -o empty -e empty ./cp b c
atf_check -s exit:0 -o empty -e empty test -f c
test_unmount
}
@ -74,13 +74,13 @@ dir_head() {
dir_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir d
atf_check -s eq:1 -o empty -e empty test -f d/foo
atf_check -s eq:1 -o empty -e empty test -f e/foo
atf_check -s eq:0 -o empty -e empty ln -s d e
atf_check -s eq:0 -o empty -e empty touch d/foo
atf_check -s eq:0 -o empty -e empty test -f d/foo
atf_check -s eq:0 -o empty -e empty test -f e/foo
atf_check -s exit:0 -o empty -e empty mkdir d
atf_check -s exit:1 -o empty -e empty test -f d/foo
atf_check -s exit:1 -o empty -e empty test -f e/foo
atf_check -s exit:0 -o empty -e empty ln -s d e
atf_check -s exit:0 -o empty -e empty touch d/foo
atf_check -s exit:0 -o empty -e empty test -f d/foo
atf_check -s exit:0 -o empty -e empty test -f e/foo
test_unmount
}
@ -94,11 +94,11 @@ kqueue_head() {
kqueue_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir dir
atf_check -s exit:0 -o empty -e empty mkdir dir
echo 'ln -s non-existent dir/a' | kqueue_monitor 1 dir
kqueue_check dir NOTE_WRITE
atf_check -s eq:0 -o empty -e empty rm dir/a
atf_check -s eq:0 -o empty -e empty rmdir dir
atf_check -s exit:0 -o empty -e empty rm dir/a
atf_check -s exit:0 -o empty -e empty rmdir dir
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_times.sh,v 1.7 2024/04/04 16:58:35 christos Exp $
# $NetBSD: t_times.sh,v 1.8 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -38,7 +38,7 @@ empty_head() {
empty_body() {
test_mount
atf_check -s eq:0 -o empty -e empty touch a
atf_check -s exit:0 -o empty -e empty touch a
eval $(stat -s a | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
[ ${ost_birthtime} -eq ${ost_atime} ] || \
atf_fail "Incorrect atime: ${ost_birthtime} != ${ost_atime}"
@ -48,7 +48,7 @@ empty_body() {
atf_fail "Incorrect mtime: ${ost_birthtime} != ${ost_mtime}"
sleep 1
atf_check -s eq:0 -o empty -e empty cat a
atf_check -s exit:0 -o empty -e empty cat a
eval $(stat -s a) || atf_fail "stat failed"
[ ${st_atime} -gt ${ost_atime} ] || \
atf_fail "Incorrect atime: ${st_atime} <= ${ost_atime}"
@ -83,7 +83,7 @@ non_empty_body() {
eval $(stat -s b | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
sleep 1
atf_check -s eq:0 -o inline:"foo\n" -e empty cat b
atf_check -s exit:0 -o inline:"foo\n" -e empty cat b
eval $(stat -s b) || atf_fail "stat failed"
[ ${st_atime} -gt ${ost_atime} ] || \
atf_fail "Incorrect atime: ${st_atime} <= ${ost_atime}"
@ -108,7 +108,7 @@ link_body() {
eval $(stat -s c | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
sleep 1
atf_check -s eq:0 -o empty -e empty ln c d
atf_check -s exit:0 -o empty -e empty ln c d
eval $(stat -s c) || atf_fail "stat failed"
[ ${st_atime} -eq ${ost_atime} ] || \
atf_fail "Incorrect atime: ${st_atime} != ${ost_atime}"
@ -129,12 +129,12 @@ rename_head() {
rename_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir e
atf_check -s exit:0 -o empty -e empty mkdir e
echo foo >e/a || atf_fail "Creation failed"
eval $(stat -s e | sed -e 's|st_|dost_|g') || atf_fail "stat failed"
eval $(stat -s e/a | sed -e 's|st_|ost_|g') || atf_fail "stat failed"
sleep 1
atf_check -s eq:0 -o empty -e empty mv e/a e/b
atf_check -s exit:0 -o empty -e empty mv e/a e/b
eval $(stat -s e | sed -e 's|st_|dst_|g') || atf_fail "stat failed"
eval $(stat -s e/b) || atf_fail "stat failed"
[ ${st_atime} -eq ${ost_atime} ] || \

View File

@ -1,4 +1,4 @@
# $NetBSD: t_trail_slash.sh,v 1.5 2010/11/07 17:51:18 jmmv Exp $
# $NetBSD: t_trail_slash.sh,v 1.6 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -35,11 +35,11 @@ main_head() {
main_body() {
test_mount
atf_check -s eq:0 -o empty -e empty mkdir a/
atf_check -s eq:0 -o empty -e empty touch a/b
atf_check -s eq:0 -o empty -e empty test -f a/b
atf_check -s eq:0 -o empty -e empty rm a/b
atf_check -s eq:0 -o empty -e empty rmdir a/
atf_check -s exit:0 -o empty -e empty mkdir a/
atf_check -s exit:0 -o empty -e empty touch a/b
atf_check -s exit:0 -o empty -e empty test -f a/b
atf_check -s exit:0 -o empty -e empty rm a/b
atf_check -s exit:0 -o empty -e empty rmdir a/
test_unmount
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_vnd.sh,v 1.13 2024/04/04 16:57:45 christos Exp $
# $NetBSD: t_vnd.sh,v 1.14 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -40,14 +40,14 @@ basic_head() {
basic_body() {
test_mount
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
dd if=/dev/zero of=disk.img bs=1m count=10
atf_check -s eq:0 -o empty -e empty vndconfig -c ${vnddev} disk.img
atf_check -s exit:0 -o empty -e empty vndconfig -c ${vnddev} disk.img
atf_check -s eq:0 -o ignore -e ignore newfs -I ${rvnd}
atf_check -s exit:0 -o ignore -e ignore newfs -I ${rvnd}
atf_check -s eq:0 -o empty -e empty mkdir mnt
atf_check -s eq:0 -o empty -e empty mount ${vnd} mnt
atf_check -s exit:0 -o empty -e empty mkdir mnt
atf_check -s exit:0 -o empty -e empty mount ${vnd} mnt
echo "Creating test files"
for f in $(jot -w %u 100 | uniq); do
@ -61,8 +61,8 @@ basic_body() {
atf_fail "Invalid checksum for file ${f}"
done
atf_check -s eq:0 -o empty -e empty umount mnt
atf_check -s eq:0 -o empty -e empty vndconfig -u ${vnddev}
atf_check -s exit:0 -o empty -e empty umount mnt
atf_check -s exit:0 -o empty -e empty vndconfig -u ${vnddev}
test_unmount
touch done

View File

@ -1,4 +1,4 @@
# $NetBSD: t_vnode_leak.sh,v 1.7 2018/01/17 00:23:17 maya Exp $
# $NetBSD: t_vnode_leak.sh,v 1.8 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,7 +37,7 @@ main_head() {
main_body() {
echo "Lowering kern.maxvnodes to 2000"
sysctl -n kern.maxvnodes >oldvnodes
atf_check -s eq:0 -o ignore -e empty sysctl -w kern.maxvnodes=2000
atf_check -s exit:0 -o ignore -e empty sysctl -w kern.maxvnodes=2000
test_mount -o -s$(((4000 + 2) * 4096))
echo "Creating 4000 directories"

View File

@ -1,4 +1,4 @@
# $NetBSD: t_factor.sh,v 1.11 2020/10/11 18:43:50 christos Exp $
# $NetBSD: t_factor.sh,v 1.12 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@ -31,7 +31,7 @@ expect() {
if [ -n "$3" ] && [ $ncrypt -eq 0 ] ; then
atf_skip "crypto needed for huge non-prime factors - PR bin/23663"
fi
atf_check -s eq:0 -o file:expout -e empty /usr/games/factor ${1}
atf_check -s exit:0 -o file:expout -e empty /usr/games/factor ${1}
}
atf_test_case overflow1

View File

@ -1,4 +1,4 @@
# $NetBSD: t_tcpip.sh,v 1.23 2023/08/05 13:13:37 riastradh Exp $
# $NetBSD: t_tcpip.sh,v 1.24 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2011 The NetBSD Foundation, Inc.
# All rights reserved.
@ -88,8 +88,8 @@ start_sshd() {
cp $(atf_get_srcdir)/ssh_host_key .
atf_check -s ignore -o empty -e ignore \
cp $(atf_get_srcdir)/ssh_host_key.pub .
atf_check -s eq:0 -o empty -e empty chmod 400 ssh_host_key
atf_check -s eq:0 -o empty -e empty chmod 444 ssh_host_key.pub
atf_check -s exit:0 -o empty -e empty chmod 400 ssh_host_key
atf_check -s exit:0 -o empty -e empty chmod 444 ssh_host_key.pub
# Start in debugging mode so we don't have parent<->child privsep stuff
env LD_PRELOAD=/usr/lib/librumphijack.so \
@ -101,14 +101,14 @@ start_sshd() {
sleep 1
echo "Setting up SSH client configuration"
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
ssh-keygen -f ssh_user_key -t rsa -b 1024 -N "" -q
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
cp ssh_user_key.pub authorized_keys
echo "127.0.0.1,localhost,::1 " \
"$(cat $(atf_get_srcdir)/ssh_host_key.pub)" >known_hosts || \
atf_fail "Failed to create known_hosts"
atf_check -s eq:0 -o empty -e empty chmod 600 authorized_keys
atf_check -s exit:0 -o empty -e empty chmod 600 authorized_keys
sed -e "s,@SRCDIR@,$(atf_get_srcdir),g" -e "s,@WORKDIR@,$(pwd),g" \
$(atf_get_srcdir)/ssh_config.in >ssh_config || \
atf_fail "Failed to create ssh_config"

View File

@ -1,4 +1,4 @@
# $NetBSD: t_abi_uvm.sh,v 1.3 2012/04/20 05:41:25 jruoho Exp $
# $NetBSD: t_abi_uvm.sh,v 1.4 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
@ -58,7 +58,7 @@ PAGE_SIZE_body() {
echo "Module PAGE_SIZE: ${module_pagesize}"
atf_check_equal "${kernel_pagesize}" "${module_pagesize}"
atf_check -s eq:0 -o empty -e empty modunload k_uvm
atf_check -s exit:0 -o empty -e empty modunload k_uvm
}
PAGE_SIZE_cleanup() {
modunload k_uvm >/dev/null 2>&1 || true

View File

@ -1,5 +1,5 @@
#! /usr/bin/atf-sh
# $NetBSD: t_klua_pr_52864.sh,v 1.3 2023/03/01 21:08:38 nia Exp $
# $NetBSD: t_klua_pr_52864.sh,v 1.4 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2018 The NetBSD Foundation, Inc.
# All rights reserved.
@ -41,10 +41,10 @@ luastate_body() {
fi
sysctl -q kern.lua.verbose
if [ $? -eq 1 ]; then
atf_check -s eq:0 modload lua
atf_check -s exit:0 modload lua
fi
atf_check -s eq:0 luactl -q create atfluastate
atf_check -s eq:0 -o ignore luactl
atf_check -s exit:0 luactl -q create atfluastate
atf_check -s exit:0 -o ignore luactl
}
luastate_cleanup() {

View File

@ -1,4 +1,4 @@
# $NetBSD: t_modload.sh,v 1.13 2012/04/20 05:41:25 jruoho Exp $
# $NetBSD: t_modload.sh,v 1.14 2024/04/28 07:27:41 rillig Exp $
#
# Copyright (c) 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -27,7 +27,7 @@
check_sysctl() {
echo "${1} = ${2}" >expout
atf_check -s eq:0 -o file:expout -e empty sysctl ${1}
atf_check -s exit:0 -o file:expout -e empty sysctl ${1}
}
atf_test_case plain cleanup
@ -49,14 +49,14 @@ plain_body() {
cat >experr <<EOF
modload: No such file or directory
EOF
atf_check -s eq:1 -o empty -e ignore modload non-existent.o
atf_check -s exit:1 -o empty -e ignore modload non-existent.o
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
modload $(atf_get_srcdir)/k_helper/k_helper.kmod
check_sysctl vendor.k_helper.present 1
check_sysctl vendor.k_helper.prop_int_ok 0
check_sysctl vendor.k_helper.prop_str_ok 0
atf_check -s eq:0 -o empty -e empty modunload k_helper
atf_check -s exit:0 -o empty -e empty modunload k_helper
touch done
}
plain_cleanup() {
@ -71,29 +71,29 @@ bflag_head() {
bflag_body() {
echo "Checking error conditions"
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -b foo k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid parameter.*foo' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -b foo= k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid boolean value' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -b foo=bar k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid boolean value.*bar' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -b foo=falsea k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid boolean value.*falsea' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -b foo=truea k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid boolean value.*truea' stderr
# TODO Once sysctl(8) supports CTLTYPE_BOOL nodes.
@ -121,35 +121,35 @@ iflag_body() {
echo "Checking error conditions"
atf_check -s eq:1 -o empty -e save:stderr modload -i foo \
atf_check -s exit:1 -o empty -e save:stderr modload -i foo \
k_helper/k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid parameter.*foo' stderr
atf_check -s eq:1 -o empty -e save:stderr modload -i foo= \
atf_check -s exit:1 -o empty -e save:stderr modload -i foo= \
k_helper/k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid integer value' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -i foo=bar k_helper/k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid integer value.*bar' stderr
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
modload -i foo=123a k_helper/k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid integer value.*123a' stderr
echo "Checking valid values"
for v in 5 10; do
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
modload -i prop_int="${v}" \
$(atf_get_srcdir)/k_helper/k_helper.kmod
check_sysctl vendor.k_helper.prop_int_ok 1
check_sysctl vendor.k_helper.prop_int_val "${v}"
atf_check -s eq:0 -o empty -e empty modunload k_helper
atf_check -s exit:0 -o empty -e empty modunload k_helper
done
touch done
}
@ -175,20 +175,20 @@ sflag_body() {
echo "Checking error conditions"
atf_check -s eq:1 -o empty -e save:stderr modload -s foo \
atf_check -s exit:1 -o empty -e save:stderr modload -s foo \
k_helper/k_helper.kmod
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep 'Invalid parameter.*foo' stderr
echo "Checking valid values"
for v in '1st string' '2nd string'; do
atf_check -s eq:0 -o empty -e empty \
atf_check -s exit:0 -o empty -e empty \
modload -s prop_str="${v}" \
$(atf_get_srcdir)/k_helper/k_helper.kmod
check_sysctl vendor.k_helper.prop_str_ok 1
check_sysctl vendor.k_helper.prop_str_val "${v}"
atf_check -s eq:0 -o empty -e empty modunload k_helper
atf_check -s exit:0 -o empty -e empty modunload k_helper
done
touch done
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_threadpool.sh,v 1.1 2019/01/25 18:34:45 christos Exp $
# $NetBSD: t_threadpool.sh,v 1.2 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2018 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,16 +37,16 @@ job_delay=2
read_sysctl() {
echo "${1} = ${2}" >expout
atf_check -s eq:0 -o file:expout -e empty sysctl ${1}
atf_check -s exit:0 -o file:expout -e empty sysctl ${1}
}
write_sysctl() {
atf_check -s eq:0 -o ignore -e empty sysctl -w "${1}=${2}"
atf_check -s exit:0 -o ignore -e empty sysctl -w "${1}=${2}"
}
write_sysctl_fail() {
echo "${3}" >experr
atf_check -s eq:1 -o ignore -e file:experr sysctl -w "${1}=${2}"
atf_check -s exit:1 -o ignore -e file:experr sysctl -w "${1}=${2}"
}
atf_test_case unbound cleanup

View File

@ -1,4 +1,4 @@
# $NetBSD: t_create.sh,v 1.4 2020/03/15 10:15:16 martin Exp $
# $NetBSD: t_create.sh,v 1.5 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2012 The NetBSD Foundation, Inc.
# All rights reserved.
@ -36,11 +36,11 @@ validfat32_body() {
atf_skip "not enough free space in working directory"
fi
atf_check -s eq:0 -o ignore -e ignore \
atf_check -s exit:0 -o ignore -e ignore \
newfs_msdos -b 512 -C 33m -F 32 msdos.img
# fsck_msdos/newfs_msdos have been fixed
# atf_expect_fail "PR bin/46743"
atf_check -s eq:0 -o not-match:FIXED -e empty fsck_msdos -p msdos.img
atf_check -s exit:0 -o not-match:FIXED -e empty fsck_msdos -p msdos.img
atf_expect_pass
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_rc_d_cli.sh,v 1.5 2022/02/26 16:21:59 gson Exp $
# $NetBSD: t_rc_d_cli.sh,v 1.6 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@ -36,7 +36,7 @@ no_command_body() {
export h_simple=YES
rc_helper=$(atf_get_srcdir)/h_simple
atf_check -s eq:1 -o empty -e ignore ${rc_helper}
atf_check -s exit:1 -o empty -e ignore ${rc_helper}
}
atf_test_case default_start_no_args
@ -49,7 +49,7 @@ default_start_no_args_body() {
rc_helper=$(atf_get_srcdir)/h_simple
atf_expect_fail "PR bin/56506"
atf_check -s eq:0 -o ignore -e empty ${rc_helper} start
atf_check -s exit:0 -o ignore -e empty ${rc_helper} start
${rc_helper} forcestop
atf_fail "random failure did not happen this time"
}
@ -63,7 +63,7 @@ default_start_with_args_body() {
export h_simple=YES
rc_helper=$(atf_get_srcdir)/h_simple
atf_check -s eq:1 -o ignore -e ignore ${rc_helper} start foo
atf_check -s exit:1 -o ignore -e ignore ${rc_helper} start foo
if ${rc_helper} status >/dev/null; then
${rc_helper} forcestop
atf_fail 'extra argument to start did not error out'
@ -81,7 +81,7 @@ default_stop_no_args_body() {
atf_expect_fail "PR bin/56506"
${rc_helper} start
atf_check -s eq:0 -o ignore -e empty ${rc_helper} stop
atf_check -s exit:0 -o ignore -e empty ${rc_helper} stop
atf_fail "random failure did not happen this time"
}
@ -95,7 +95,7 @@ default_stop_with_args_body() {
rc_helper=$(atf_get_srcdir)/h_simple
${rc_helper} start
atf_check -s eq:1 -o ignore -e ignore ${rc_helper} stop foo
atf_check -s exit:1 -o ignore -e ignore ${rc_helper} stop foo
if ${rc_helper} status >/dev/null; then
${rc_helper} forcestop
else
@ -114,7 +114,7 @@ default_restart_no_args_body() {
atf_expect_fail "PR bin/56506"
${rc_helper} start
atf_check -s eq:0 -o ignore -e empty ${rc_helper} restart
atf_check -s exit:0 -o ignore -e empty ${rc_helper} restart
${rc_helper} forcestop
atf_fail "random failure did not happen this time"
}
@ -129,7 +129,7 @@ default_restart_with_args_body() {
rc_helper=$(atf_get_srcdir)/h_simple
${rc_helper} start
atf_check -s eq:1 -o ignore -e ignore ${rc_helper} restart foo
atf_check -s exit:1 -o ignore -e ignore ${rc_helper} restart foo
${rc_helper} forcestop
}
@ -144,7 +144,7 @@ pre${command}:.
${command}:.
post${command}:.
EOF
atf_check -s eq:0 -o file:expout -e empty ${rc_helper} ${command}
atf_check -s exit:0 -o file:expout -e empty ${rc_helper} ${command}
}
do_overriden_with_args() {
@ -158,7 +158,7 @@ pre${command}:.
${command}: >arg1< > arg 2 < >arg3< >*<.
post${command}:.
EOF
atf_check -s eq:0 -o file:expout -e empty ${rc_helper} ${command} \
atf_check -s exit:0 -o file:expout -e empty ${rc_helper} ${command} \
'arg1' ' arg 2 ' 'arg3' '*'
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_config.sh,v 1.11 2021/10/21 13:21:55 andvar Exp $
# $NetBSD: t_config.sh,v 1.12 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
# All rights reserved.
@ -68,7 +68,7 @@ run_and_check_pass()
run_and_check_prep "${name}"
atf_check -o ignore -s eq:0 \
atf_check -o ignore -s exit:0 \
config -s "${supportdir}" -b "compile/${name}" "${config}"
}
@ -80,7 +80,7 @@ run_and_check_warn()
local stderr
eval stderr=\$${name}_stderr
atf_check -o ignore -e "${stderr}" -s eq:0 \
atf_check -o ignore -e "${stderr}" -s exit:0 \
config -s "${supportdir}" -b "compile/${name}" "${config}"
}

View File

@ -1,4 +1,4 @@
# $NetBSD: t_groups.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
# $NetBSD: t_groups.sh,v 1.2 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -42,13 +42,13 @@ correct_body() {
create_run_groups
echo "users wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh
atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh 100
atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh test
atf_check -s exit:0 -o file:expout -e empty ./run_groups.sh
atf_check -s exit:0 -o file:expout -e empty ./run_groups.sh 100
atf_check -s exit:0 -o file:expout -e empty ./run_groups.sh test
echo "wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh 0
atf_check -s eq:0 -o file:expout -e empty ./run_groups.sh root
atf_check -s exit:0 -o file:expout -e empty ./run_groups.sh 0
atf_check -s exit:0 -o file:expout -e empty ./run_groups.sh root
}
atf_test_case syntax
@ -60,8 +60,8 @@ syntax_body() {
# Give an invalid flag but which is allowed by id (with which
# groups shares code) when using the -Gn options.
atf_check -s eq:1 -o empty -e save:stderr ./run_groups.sh -r
atf_check -s eq:0 -o ignore -e empty grep '^usage:' stderr
atf_check -s exit:1 -o empty -e save:stderr ./run_groups.sh -r
atf_check -s exit:0 -o ignore -e empty grep '^usage:' stderr
}
atf_init_test_cases()

View File

@ -1,4 +1,4 @@
# $NetBSD: t_id.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
# $NetBSD: t_id.sh,v 1.2 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -42,24 +42,24 @@ default_body() {
create_run_id
echo "uid=100(test) gid=100(users) groups=100(users),0(wheel)" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh test
echo "uid=0(root) gid=0(wheel) groups=0(wheel)" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh root
export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
echo "uid=100(test) gid=100(users) euid=0(root) egid=0(wheel) groups=100(users),0(wheel)" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh
unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
echo 'id: nonexistent: No such user' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_id.sh nonexistent
atf_check -s exit:1 -o empty -e file:experr ./run_id.sh nonexistent
atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh root nonexistent
atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
atf_check -s exit:1 -o empty -e save:stderr ./run_id.sh root nonexistent
atf_check -s exit:0 -o ignore -e empty grep ^usage: stderr
}
atf_test_case primaries
@ -73,9 +73,9 @@ primaries_body() {
for p1 in -G -g -p -u; do
for p2 in -G -g -p -u; do
if [ ${p1} != ${p2} ]; then
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
./run_id.sh ${p1} ${p2}
atf_check -s eq:0 -o ignore -e empty \
atf_check -s exit:0 -o ignore -e empty \
grep ^usage: stderr
fi
done
@ -90,28 +90,28 @@ Gflag_body() {
create_run_id
echo "100 0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G test
echo "users wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G -n test
echo "0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G root
echo "wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -G -n root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G -n 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -G -n root
echo 'id: nonexistent: No such user' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -G nonexistent
atf_check -s exit:1 -o empty -e file:experr ./run_id.sh -G nonexistent
atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -G root nonexistent
atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
atf_check -s exit:1 -o empty -e save:stderr ./run_id.sh -G root nonexistent
atf_check -s exit:0 -o ignore -e empty grep ^usage: stderr
}
atf_test_case gflag
@ -122,66 +122,66 @@ gflag_body() {
create_run_id
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g test
echo "users" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n test
echo "0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g root
echo "wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n root
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r
echo "users" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r test
echo "users" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n test
export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
echo "0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g
echo "wheel" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r
echo "users" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r test
echo "users" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -g -r -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -g -r -n test
unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
echo 'id: nonexistent: No such user' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -g nonexistent
atf_check -s exit:1 -o empty -e file:experr ./run_id.sh -g nonexistent
atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -g root nonexistent
atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
atf_check -s exit:1 -o empty -e save:stderr ./run_id.sh -g root nonexistent
atf_check -s exit:0 -o ignore -e empty grep ^usage: stderr
}
atf_test_case pflag
@ -195,16 +195,16 @@ pflag_body() {
uid test
groups users wheel
EOF
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p test
cat >expout <<EOF
uid root
groups wheel
EOF
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p root
export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
cat >expout <<EOF
@ -213,14 +213,14 @@ euid root
rgid users
groups users wheel
EOF
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -p
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -p
unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
echo 'id: nonexistent: No such user' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -p nonexistent
atf_check -s exit:1 -o empty -e file:experr ./run_id.sh -p nonexistent
atf_check -s eq:1 -o empty -e save:stderr ./run_id.sh -p root nonexistent
atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
atf_check -s exit:1 -o empty -e save:stderr ./run_id.sh -p root nonexistent
atf_check -s exit:0 -o ignore -e empty grep ^usage: stderr
}
atf_test_case uflag
@ -231,67 +231,67 @@ uflag_body() {
create_run_id
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u test
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n test
echo "0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u root
echo "root" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n 0
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n root
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n 0
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n root
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r test
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n test
export LIBFAKE_EGID_ROOT=1 LIBFAKE_EUID_ROOT=1
echo "0" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u
echo "root" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n
echo "100" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r test
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
atf_check -s eq:0 -o file:expout -e empty ./run_id.sh -u -r -n test
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n 100
atf_check -s exit:0 -o file:expout -e empty ./run_id.sh -u -r -n test
unset LIBFAKE_EGID_ROOT LIBFAKE_EUID_ROOT
echo 'id: nonexistent: No such user' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_id.sh -u nonexistent
atf_check -s exit:1 -o empty -e file:experr ./run_id.sh -u nonexistent
atf_check -s eq:1 -o empty -e save:stderr \
atf_check -s exit:1 -o empty -e save:stderr \
./run_id.sh -u root nonexistent
atf_check -s eq:0 -o ignore -e empty grep ^usage: stderr
atf_check -s exit:0 -o ignore -e empty grep ^usage: stderr
}
atf_init_test_cases()

View File

@ -1,4 +1,4 @@
# $NetBSD: t_whoami.sh,v 1.1 2012/03/17 16:33:14 jruoho Exp $
# $NetBSD: t_whoami.sh,v 1.2 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@ -43,12 +43,12 @@ correct_body() {
echo "Checking with EUID=100"
echo "test" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_whoami.sh
atf_check -s exit:0 -o file:expout -e empty ./run_whoami.sh
echo "Checking with EUID=0"
export LIBFAKE_EUID_ROOT=1
echo "root" >expout
atf_check -s eq:0 -o file:expout -e empty ./run_whoami.sh
atf_check -s exit:0 -o file:expout -e empty ./run_whoami.sh
}
atf_test_case syntax
@ -60,12 +60,12 @@ syntax_body() {
# Give a user to the command.
echo 'usage: whoami' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_whoami.sh root
atf_check -s exit:1 -o empty -e file:experr ./run_whoami.sh root
# Give an invalid flag but which is allowed by id (with which
# whoami shares code) when using the -un options.
echo 'usage: whoami' >experr
atf_check -s eq:1 -o empty -e file:experr ./run_whoami.sh -r
atf_check -s exit:1 -o empty -e file:experr ./run_whoami.sh -r
}
atf_init_test_cases()

View File

@ -1,4 +1,4 @@
# $NetBSD: t_sets.sh,v 1.4 2024/01/30 16:57:32 martin Exp $
# $NetBSD: t_sets.sh,v 1.5 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2024 The NetBSD Foundation, Inc.
# All rights reserved.
@ -30,7 +30,7 @@ check_mtree()
local set=$1
cd /
atf_check -o empty -s eq:0 \
atf_check -o empty -s exit:0 \
mtree -e </etc/mtree/set."$set"
}

View File

@ -1,6 +1,6 @@
#! /bin/sh
# $NetBSD: Testspec,v 1.2 2016/06/01 14:52:56 agc Exp $
# $NetBSD: Testspec,v 1.3 2024/04/28 07:27:42 rillig Exp $
# Copyright (c) 2016 Alistair Crooks <agc@NetBSD.org>
# All rights reserved.
@ -58,30 +58,30 @@ expected33
expected34
expected35
'
TESTSET_1_CASE_1="-s eq:0 -o file:1.expected -e empty b2e < 1.in"
TESTSET_1_CASE_2="-s eq:0 -o file:2.expected -e empty b2e < 2.in"
TESTSET_1_CASE_1="-s exit:0 -o file:1.expected -e empty b2e < 1.in"
TESTSET_1_CASE_2="-s exit:0 -o file:2.expected -e empty b2e < 2.in"
TESTSET_1_CASE_1="-s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg"
DISABLE_TESTSET_1_CASE_2="-s eq:0 -o file:expected17 -e empty netpgpverify -c verify a.gpg"
TESTSET_1_CASE_3="-s eq:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -c verify a.gpg"
TESTSET_1_CASE_4="-s eq:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -c verify NetBSD-6.0_RC2_hashes.asc"
TESTSET_1_CASE_5="-s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc"
TESTSET_1_CASE_6="-s eq:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify < a.gpg"
TESTSET_1_CASE_7="-s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc"
TESTSET_1_CASE_8="-s eq:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc"
TESTSET_1_CASE_9="-s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg"
DISABLE_TESTSET_1_CASE_10="-s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg"
DISABLE_TESTSET_1_CASE_11="-s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg"
TESTSET_1_CASE_12="-s eq:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc"
TESTSET_1_CASE_13="-s eq:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc"
DISABLE_TESTSET_1_CASE_14="-s eq:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg"
DISABLE_TESTSET_1_CASE_15="-s eq:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg"
TESTSET_1_CASE_16="-s eq:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg"
TESTSET_1_CASE_17="-s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg"
TESTSET_1_CASE_18="-s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg"
TESTSET_1_CASE_19="-s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig"
TESTSET_1_CASE_20="-s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -c cat -k pubring.gpg det.sig"
DISABLE_TESTSET_1_CASE_21="-s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc"
TESTSET_1_CASE_1="-s exit:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg"
DISABLE_TESTSET_1_CASE_2="-s exit:0 -o file:expected17 -e empty netpgpverify -c verify a.gpg"
TESTSET_1_CASE_3="-s exit:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -c verify a.gpg"
TESTSET_1_CASE_4="-s exit:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -c verify NetBSD-6.0_RC2_hashes.asc"
TESTSET_1_CASE_5="-s exit:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc"
TESTSET_1_CASE_6="-s exit:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify < a.gpg"
TESTSET_1_CASE_7="-s exit:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc"
TESTSET_1_CASE_8="-s exit:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc"
TESTSET_1_CASE_9="-s exit:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg"
DISABLE_TESTSET_1_CASE_10="-s exit:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg"
DISABLE_TESTSET_1_CASE_11="-s exit:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg"
TESTSET_1_CASE_12="-s exit:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc"
TESTSET_1_CASE_13="-s exit:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc"
DISABLE_TESTSET_1_CASE_14="-s exit:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg"
DISABLE_TESTSET_1_CASE_15="-s exit:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg"
TESTSET_1_CASE_16="-s exit:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg"
TESTSET_1_CASE_17="-s exit:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg"
TESTSET_1_CASE_18="-s exit:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg"
TESTSET_1_CASE_19="-s exit:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig"
TESTSET_1_CASE_20="-s exit:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -c cat -k pubring.gpg det.sig"
DISABLE_TESTSET_1_CASE_21="-s exit:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc"
TESTSET_2_NAME=dsa_signatures
TESTSET_2_FILES='
@ -102,13 +102,13 @@ expected44
expected45
expected46
'
TESTSET_2_CASE_1="-s eq:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg"
TESTSET_2_CASE_2="-s eq:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg"
TESTSET_2_CASE_3="-s eq:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc"
TESTSET_2_CASE_4="-s eq:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc"
TESTSET_2_CASE_5="-s eq:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg"
TESTSET_2_CASE_6="-s eq:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg"
TESTSET_2_CASE_7="-s eq:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc"
TESTSET_2_CASE_8="-s eq:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc"
TESTSET_2_CASE_9="-s eq:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg"
TESTSET_2_CASE_10="-s eq:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc"
TESTSET_2_CASE_1="-s exit:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg"
TESTSET_2_CASE_2="-s exit:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg"
TESTSET_2_CASE_3="-s exit:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc"
TESTSET_2_CASE_4="-s exit:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc"
TESTSET_2_CASE_5="-s exit:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg"
TESTSET_2_CASE_6="-s exit:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg"
TESTSET_2_CASE_7="-s exit:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc"
TESTSET_2_CASE_8="-s exit:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc"
TESTSET_2_CASE_9="-s exit:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg"
TESTSET_2_CASE_10="-s exit:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc"

View File

@ -1,6 +1,6 @@
#! /bin/sh
# $NetBSD: t_netpgpverify.sh,v 1.4 2016/08/28 15:59:15 christos Exp $
# $NetBSD: t_netpgpverify.sh,v 1.5 2024/04/28 07:27:42 rillig Exp $
#
# Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -7193,26 +7193,26 @@ IGl0IHN0YXRpY2FsbHkgbGlua2VkIGFzIHdlbGw/Cm11bHRpcGxlIGZpbGVzIGlu
IG5ldHBncHZlcmlmeQo=
====
EOF
atf_check -s eq:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
atf_check -s eq:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify a.gpg
# atf_check -s eq:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify NetBSD-6.0_RC2_hashes.asc
atf_check -s eq:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
atf_check -s eq:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < a.gpg
atf_check -s eq:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
# atf_check -s eq:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc
atf_check -s eq:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
#atf_check -s eq:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
#atf_check -s eq:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
atf_check -s eq:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc
atf_check -s eq:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc
#atf_check -s eq:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg
#atf_check -s eq:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg
atf_check -s eq:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg
atf_check -s eq:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
atf_check -s eq:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
atf_check -s eq:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
atf_check -s eq:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat det.sig
#atf_check -s eq:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
atf_check -s exit:0 -o file:expected16 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify b.gpg
atf_check -s exit:0 -o file:expected18 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify a.gpg
# atf_check -s exit:0 -o file:expected19 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c verify NetBSD-6.0_RC2_hashes.asc
atf_check -s exit:0 -o file:expected20 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat jj.asc
atf_check -s exit:0 -o file:expected21 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < a.gpg
atf_check -s exit:0 -o file:expected22 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < jj.asc
# atf_check -s exit:0 -o file:expected23 -e empty env TZ=US/Pacific netpgpverify < NetBSD-6.0_RC2_hashes.asc
atf_check -s exit:0 -o file:expected24 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < b.gpg
#atf_check -s exit:0 -o file:expected25 -e empty netpgpverify NetBSD-6.0_RC1_hashes.gpg
#atf_check -s exit:0 -o file:expected26 -e empty netpgpverify < NetBSD-6.0_RC1_hashes.gpg
atf_check -s exit:0 -o file:expected27 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg < NetBSD-6.0_hashes.asc
atf_check -s exit:0 -o file:expected28 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg NetBSD-6.0_hashes.asc
#atf_check -s exit:0 -o file:expected29 -e empty netpgpverify NetBSD-6.0_RC1_hashes_ascii.gpg
#atf_check -s exit:0 -o file:expected30 -e empty netpgpverify < NetBSD-6.0_RC1_hashes_ascii.gpg
atf_check -s exit:0 -o file:expected31 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg b.gpg b.gpg
atf_check -s exit:0 -o file:expected32 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg b.gpg b.gpg b.gpg
atf_check -s exit:0 -o file:expected33 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat b.gpg jj.asc b.gpg
atf_check -s exit:0 -o file:expected34 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg det.sig
atf_check -s exit:0 -o file:expected35 -e empty env TZ=US/Pacific netpgpverify -k pubring.gpg -c cat det.sig
#atf_check -s exit:0 -o file:expected46 -e empty netpgpverify -k problem-pubring.gpg NetBSD-6.0_hashes.asc
}
# Test set 2 (dsa_signatures) for netpgpverify
@ -7407,16 +7407,16 @@ LTIzIFtFeHBpcnkgMjAxOS0wNi0yMV0KZmluZ2VycHJpbnQ6ICAxOTE1IDA4MDEg
ZmJkOCBmNDVkIDg5ZjIgMDIwNSA5ZmYyIGMyNGYgZGYyYyBlNjIwIAoK
====
EOF
atf_check -s eq:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg
atf_check -s eq:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg
atf_check -s eq:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc
atf_check -s eq:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc
atf_check -s eq:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg
atf_check -s eq:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg
atf_check -s eq:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc
atf_check -s eq:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc
atf_check -s eq:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg
atf_check -s eq:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc
atf_check -s exit:0 -o file:expected36 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.gpg
atf_check -s exit:0 -o file:expected37 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.gpg
atf_check -s exit:0 -o file:expected38 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in1.asc
atf_check -s exit:0 -o file:expected39 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg < in1.asc
atf_check -s exit:0 -o file:expected40 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.gpg
atf_check -s exit:0 -o file:expected41 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.gpg
atf_check -s exit:0 -o file:expected42 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat in1.asc
atf_check -s exit:0 -o file:expected43 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg -c cat < in1.asc
atf_check -s exit:0 -o file:expected44 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.gpg
atf_check -s exit:0 -o file:expected45 -e empty env TZ=US/Pacific netpgpverify -k dsa-pubring.gpg in2.asc
}
# all test sets

View File

@ -1,4 +1,4 @@
# $NetBSD: t_sdiff.sh,v 1.1 2012/03/17 16:33:15 jruoho Exp $
# $NetBSD: t_sdiff.sh,v 1.2 2024/04/28 07:27:43 rillig Exp $
#
# Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
# All rights reserved.
@ -32,13 +32,13 @@ flags_head()
}
flags_body()
{
atf_check -o file:$(atf_get_srcdir)/d_flags_l.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_flags_l.out -s exit:1 \
sdiff -l "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
atf_check -o file:$(atf_get_srcdir)/d_flags_s.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_flags_s.out -s exit:1 \
sdiff -s "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
atf_check -o file:$(atf_get_srcdir)/d_flags_w.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_flags_w.out -s exit:1 \
sdiff -w 125 "$(atf_get_srcdir)/d_input1" "$(atf_get_srcdir)/d_input2"
}
@ -52,14 +52,14 @@ iflags_body()
tail1="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input1 $(atf_get_srcdir)/d_input2"
tail2="-w 125 -I .*filename.* $(atf_get_srcdir)/d_input2 $(atf_get_srcdir)/d_input1"
atf_check -o file:$(atf_get_srcdir)/d_iflags_a1.out -s eq:1 sdiff ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_a2.out -s eq:1 sdiff ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_b1.out -s eq:1 sdiff -s ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_b2.out -s eq:1 sdiff -s ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_c1.out -s eq:1 sdiff -l ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_c2.out -s eq:1 sdiff -l ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_d1.out -s eq:1 sdiff -s ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_d2.out -s eq:1 sdiff -s ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_a1.out -s exit:1 sdiff ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_a2.out -s exit:1 sdiff ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_b1.out -s exit:1 sdiff -s ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_b2.out -s exit:1 sdiff -s ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_c1.out -s exit:1 sdiff -l ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_c2.out -s exit:1 sdiff -l ${tail2}
atf_check -o file:$(atf_get_srcdir)/d_iflags_d1.out -s exit:1 sdiff -s ${tail1}
atf_check -o file:$(atf_get_srcdir)/d_iflags_d2.out -s exit:1 sdiff -s ${tail2}
}
atf_test_case tabs
@ -69,7 +69,7 @@ tabs_head()
}
tabs_body()
{
atf_check -o file:$(atf_get_srcdir)/d_tabs.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_tabs.out -s exit:1 \
sdiff "$(atf_get_srcdir)/d_tabs1.in" "$(atf_get_srcdir)/d_tabs2.in"
}
@ -80,13 +80,13 @@ tabends_head()
}
tabends_body()
{
atf_check -o file:$(atf_get_srcdir)/d_tabends_a.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_tabends_a.out -s exit:1 \
sdiff -w30 "$(atf_get_srcdir)/d_tabends.in" /dev/null
atf_check -o file:$(atf_get_srcdir)/d_tabends_b.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_tabends_b.out -s exit:1 \
sdiff -w30 /dev/null "$(atf_get_srcdir)/d_tabends.in"
atf_check -o file:$(atf_get_srcdir)/d_tabends_c.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_tabends_c.out -s exit:1 \
sdiff -w19 "$(atf_get_srcdir)/d_tabends.in" /dev/null
}
@ -142,10 +142,10 @@ oneline_head()
}
oneline_body()
{
atf_check -o file:$(atf_get_srcdir)/d_oneline_a.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_oneline_a.out -s exit:1 \
sdiff /dev/null "$(atf_get_srcdir)/d_oneline.in"
atf_check -o file:$(atf_get_srcdir)/d_oneline_b.out -s eq:1 \
atf_check -o file:$(atf_get_srcdir)/d_oneline_b.out -s exit:1 \
sdiff "$(atf_get_srcdir)/d_oneline.in" /dev/null
}
@ -157,10 +157,10 @@ dot_head()
dot_body()
{
echo ". <" > expout
atf_check -o file:expout -s eq:1 sdiff "$(atf_get_srcdir)/d_dot.in" /dev/null
atf_check -o file:expout -s exit:1 sdiff "$(atf_get_srcdir)/d_dot.in" /dev/null
echo " > ." > expout
atf_check -o file:expout -s eq:1 sdiff /dev/null "$(atf_get_srcdir)/d_dot.in"
atf_check -o file:expout -s exit:1 sdiff /dev/null "$(atf_get_srcdir)/d_dot.in"
}
atf_test_case stdin
@ -171,11 +171,11 @@ stdin_head()
stdin_body()
{
echo " > stdin" > expout
atf_check -o file:expout -s eq:1 -x \
atf_check -o file:expout -s exit:1 -x \
"echo stdin | sdiff /dev/null /dev/stdin"
echo "stdin <" > expout
atf_check -o file:expout -s eq:1 -x \
atf_check -o file:expout -s exit:1 -x \
"echo stdin | sdiff /dev/stdin /dev/null"
}