Skip to content
Snippets Groups Projects
Commit abf6fbd1 authored by Frederic Danis's avatar Frederic Danis
Browse files

Merge commit '3e4dea3e' into apertis/v2023dev1

# Conflicts:
#	common/update-test-path
parents 2b0b9366 3e4dea3e
Branches apertis/v2025dev1
No related tags found
1 merge request!11Pull common subtree
Pipeline #413871 passed
......@@ -7,12 +7,24 @@ usage () {
echo "'$0 pull' is used to update the common subtree in tests"
}
branch="$(git symbolic-ref --short HEAD)"
case "$branch" in
apertis/*)
;;
*)
# take the default remote branch if we're not on a apertis/* branch
branch=$(git ls-remote --symref git@gitlab.apertis.org:tests/common.git HEAD \
| grep ^ref: \
| sed 's,ref: refs/heads/\(.*\)\s\+HEAD,\1,')
;;
esac
case $1 in
pull)
git subtree pull -P common git@gitlab.apertis.org:tests/common.git master
git subtree pull -P common git@gitlab.apertis.org:tests/common.git "$branch"
;;
add)
git subtree add -P common git@gitlab.apertis.org:tests/common.git master
git subtree add -P common git@gitlab.apertis.org:tests/common.git "$branch"
;;
*) usage;;
esac
......@@ -8,7 +8,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
. common/common-apparmor.sh
PWD=$(cd $(dirname $0); pwd; cd - >/dev/null 2>&1)
. ${PWD}/common-apparmor.sh
ALTERNATIVE_SEPARATOR="## alternative ##"
END=2
......@@ -70,6 +71,7 @@ fi
# Create a temporary directory for files
TMP_DIR=$(mktemp -d)
trap "rm -rf $TMP_DIR; exit" EXIT
# Log start time
START_TIME=$(date +"%F %T")
......@@ -81,7 +83,7 @@ else
CMD="$*"
fi
CMDLINE="common/run-test-in-systemd"
CMDLINE="${PWD}/run-test-in-systemd"
if [ ! -x $CMDLINE ]; then
echo "common/run-test-in-systemd not found"
exit 1
......@@ -123,7 +125,14 @@ sleep 3
# Get audit information from journal
AUDIT_FILE=${TMP_DIR}/AUDIT
journalctl -S "${START_TIME}" -t audit -o cat > ${AUDIT_FILE}
uid=$(id -u)
JOURNALCTL="journalctl"
if [ "${UID}" != "0" ]
then
JOURNALCTL="sudo journalctl"
fi
${JOURNALCTL} -S "${START_TIME}" -t audit -o cat > ${AUDIT_FILE}
echo "#=== ${TEST_TITLE} ==="
......@@ -135,7 +144,7 @@ echo "#---8<--- expected parsed apparmor output from journal"
cat ${EXPECT_FILE} | sed 's/^/# /'
echo "#--->8---"
csplit ${EXPECT_FILE} -f ${TMP_DIR}/EXPECT -b "%d" "/^${ALTERNATIVE_SEPARATOR}$/" {*}
csplit ${EXPECT_FILE} -f ${TMP_DIR}/EXPECT -b "%0d" "/^${ALTERNATIVE_SEPARATOR}$/" {*}
# Old versions of csplit don't provide "--suppress-matched", strip separator separately
for FILE in ${TMP_DIR}/EXPECT*; do
......
......@@ -300,7 +300,7 @@ ${systemctl} stop ${service} || :
debug "waiting for end-of-file on command output..."
wait "$cat_fifo_pid" || result=fail
rm -fr "${user_log_dir}" || result=fail
${as_target_user} rm -fr "${user_log_dir}" || result=fail
if [ -n "${lava_runes}" ]; then
"lava-test-case" "${name}" --result "${result}"
......
......@@ -6,11 +6,11 @@ PATH=${TESTPATH}/common:${TESTPATH}/bin:$PATH
# Path for architecture specific binaries
case `uname -m` in
x86_64) ARCHDIR=amd64 ;;
armv7l) ARCHDIR=armhf ;;
aarch64) ARCHDIR=arm64 ;;
x86_64) ARCHDIR=amd64 ; ARCHLIBDIR=x86_64-linux-gnu ;;
armv7l) ARCHDIR=armhf ; ARCHLIBDIR=arm-linux-gnueabihf ;;
aarch64) ARCHDIR=arm64 ; ARCHLIBDIR=aarch64-linux-gnu ;;
esac
PATH=${TESTPATH}/${ARCHDIR}/bin:$PATH
export LD_LIBRARY_PATH=${TESTPATH}/${ARCHDIR}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${TESTPATH}/${ARCHDIR}/lib:${LD_LIBRARY_PATH:-}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment