2
# Copyright (C) 2002-2005 Novell/SUSE
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License as
6
# published by the Free Software Foundation, version 2 of the
11
# This test verifies read/write operation. AppArmor caches a successful open
12
# but checks (on read/write) to see if a confined processes profile has been
13
# replaced asynchronously. If it has, access is reevaluated. The test waits
14
# for a signal at which point it reattempts to write, read and verify data. The
15
# controlling script performs a profile replacement before sending the signal
16
# for the test to reattempt the io.
20
pwd=`cd $pwd ; /bin/pwd`
32
genprofile $file:$okperm
34
runtestbg "READ/WRITE pass" pass $file
48
genprofile $file:$okperm
50
runtestbg "READ/WRITE fail" fail $file
56
genprofile $file:$badperm
58
# problem the shell and the test program are racing, after profile replacement
59
# if the shell runs immediately after profile replacement instead of the
60
# test program it will will. We insert a small sleep to make this unlikely