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