#!/bin/sh
export TCID=smack_set_current
export TST_TOTAL=1
. test.sh
. smack_common.sh
not_floor_label="XYZZY"
start_label=$(cat /proc/self/attr/current 2>/dev/null)
echo "$not_floor_label" 2>/dev/null > /proc/self/attr/current
label=$(cat /proc/self/attr/current 2>/dev/null)
if [ "$label" != "$not_floor_label" ]; then
tst_brkm TFAIL "The smack label reported for the current process is" \
"\"$label\", not the expected \"$not_floor_label\"."
fi
echo "$start_label" 2>/dev/null > /proc/self/attr/current
label=$(cat /proc/self/attr/current 2> /dev/null)
if [ "$label" != "$start_label" ]; then
tst_brkm TFAIL "The smack label reported for the current process is" \
"\"$label\", not the expected \"$start_label\"."
fi
tst_resm TPASS "Test \"$TCID\" success."
tst_exit