ostree/tests/installed/itest-deploy-selinux.sh
Colin Walters 371b4a5e7e checkout: Fix SELinux policy labeling when recursing
The code here tried to truncate the string to the previous length,
but that doesn't work when recursing, since further calls change the
length.

What actually ended up happening was the string would get corrupted
after the first level of recursion.

Closes: #936
Approved by: jlebon
2017-06-16 14:54:29 +00:00

27 lines
699 B
Bash
Executable File

#!/bin/bash
# Verify our /etc merge works with selinux
set -xeuo pipefail
dn=$(dirname $0)
. ${dn}/libinsttest.sh
# Create a new deployment
ostree admin deploy --karg-proc-cmdline ${host_refspec}
new_deployment_path=/ostree/deploy/${host_osname}/deploy/${host_commit}.1
# A set of files that have a variety of security contexts
for file in fstab passwd exports hostname sysctl.conf /etc/yum.repos.d \
/etc/NetworkManager/dispatcher.d/hook-network-manager; do
if ! test -e ${file}; then
continue
fi
current=$(cd /etc && ls -Z ${file})
new=$(cd ${new_deployment_path}/etc && ls -Z ${file})
assert_streq "${current}" "${new}"
done
ostree admin undeploy 0