xref: /aosp_15_r20/external/ltp/testcases/kernel/security/smack/README (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard WorkerThese testcases test the Smack Security Module. And they are not part of
2*49cdfc7eSAndroid Build Coastguard Workerdefault LTP build/install/run.
3*49cdfc7eSAndroid Build Coastguard Worker
4*49cdfc7eSAndroid Build Coastguard WorkerA kernel with Smack configured is required to run the Smack testsuite.
5*49cdfc7eSAndroid Build Coastguard Worker(Please see ltp/README for all those config options)
6*49cdfc7eSAndroid Build Coastguard WorkerThe smackfs filesystem must be mounted at /smack. One way to accomplish
7*49cdfc7eSAndroid Build Coastguard Workerthis is to:
8*49cdfc7eSAndroid Build Coastguard Worker1) Create a directory first:
9*49cdfc7eSAndroid Build Coastguard Worker	mkdir -p /smack
10*49cdfc7eSAndroid Build Coastguard Worker
11*49cdfc7eSAndroid Build Coastguard Worker2) Include this line in the /etc/fstab file:
12*49cdfc7eSAndroid Build Coastguard Worker	smackfs /smack smackfs defaults 0 0
13*49cdfc7eSAndroid Build Coastguard Worker
14*49cdfc7eSAndroid Build Coastguard Worker3) Do:
15*49cdfc7eSAndroid Build Coastguard Worker	mount -a
16*49cdfc7eSAndroid Build Coastguard Worker
17*49cdfc7eSAndroid Build Coastguard Worker4) Building/Installing the tests:
18*49cdfc7eSAndroid Build Coastguard Worker	Each test is designed to be independent. The tests can be built
19*49cdfc7eSAndroid Build Coastguard Workerusing the default make target.
20*49cdfc7eSAndroid Build Coastguard Worker	(cd testcases/kernel/security/smack; make && make install)
21*49cdfc7eSAndroid Build Coastguard Worker
22*49cdfc7eSAndroid Build Coastguard Worker5) Running the tests:
23*49cdfc7eSAndroid Build Coastguard Worker	./runltp -f smack
24*49cdfc7eSAndroid Build Coastguard Worker
25*49cdfc7eSAndroid Build Coastguard WorkerEach test exits with 0 on success and an error code on failure.
26*49cdfc7eSAndroid Build Coastguard Worker
27