~apparmor-dev/apparmor/master

« back to all changes in this revision

Viewing changes to tests/regression/apparmor/pwrite.sh

  • Committer: Steve Beattie
  • Date: 2019-02-19 09:38:13 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219093813-ud526ee6hwn8nljz
The AppArmor project has been converted to git and is now hosted on
gitlab.

To get the converted repository, please do
  git clone https://gitlab.com/apparmor/apparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/bash
2
 
#       Copyright (C) 2002-2005 Novell/SUSE
3
 
#
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
7
 
#       License.
8
 
 
9
 
#=NAME pwrite
10
 
#=DESCRIPTION pread/pwrite test
11
 
 
12
 
pwd=`dirname $0`
13
 
pwd=`cd $pwd ; pwd`
14
 
 
15
 
bin=$pwd
16
 
 
17
 
. $bin/prologue.inc
18
 
 
19
 
file=${tmpdir}/pwrite
20
 
okperm=rw
21
 
badwriteperm=r
22
 
badreadperm=w
23
 
 
24
 
# PASS TEST (pass 1)
25
 
 
26
 
genprofile $file:$okperm signal:receive:peer=unconfined
27
 
 
28
 
runtestbg "PREAD/PWRITE with rw" pass $file
29
 
 
30
 
sleep 2
31
 
 
32
 
# PASS TEST (pass 2)
33
 
 
34
 
kill -USR1 $_pid
35
 
 
36
 
checktestbg
37
 
 
38
 
rm -f ${file}
39
 
 
40
 
# Disabled revalidation/revocation test as this can not be reliably tested
41
 
# at this time 
42
 
## FAIL TEST - PWRITE (pass 1)
43
 
#
44
 
#genprofile $file:$okperm
45
 
#
46
 
#runtestbg "PWRITE without w" fail $file
47
 
#
48
 
#sleep 2
49
 
#
50
 
## FAIL TEST - PWRITE (pass 2)
51
 
#
52
 
#genprofile $file:$badwriteperm
53
 
#
54
 
#sleep 2
55
 
#
56
 
#kill -USR1 $_pid
57
 
#
58
 
#checktestbg
59
 
#
60
 
#rm -f ${file}
61
 
 
62
 
# Disabled revalidation/revocation test as this can not be reliably tested
63
 
# at this time 
64
 
# FAIL TEST - PREAD (pass 1)
65
 
#
66
 
#genprofile $file:$okperm
67
 
#
68
 
#runtestbg "PREAD without r" fail $file
69
 
#
70
 
#sleep 2
71
 
#
72
 
##FAIL TEST - PREAD (pass 2)
73
 
#genprofile $file:$badreadperm
74
 
#
75
 
#sleep 2
76
 
#
77
 
#kill -USR1 $_pid
78
 
#
79
 
#checktestbg
80
 
#
81
 
#rm -f ${file}