Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apparmor-dbus
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tests
apparmor-dbus
Commits
abf6fbd1
Commit
abf6fbd1
authored
3 years ago
by
Frederic Danis
Browse files
Options
Downloads
Plain Diff
Merge commit '
3e4dea3e
' into apertis/v2023dev1
# Conflicts: # common/update-test-path
parents
2b0b9366
3e4dea3e
Branches
apertis/v2025dev1
Branches containing commit
No related tags found
1 merge request
!11
Pull common subtree
Pipeline
#413871
passed
2 years ago
Stage: build
Changes
4
Pipelines
243
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
common/common-subtree.sh
+14
-2
14 additions, 2 deletions
common/common-subtree.sh
common/run-aa-test
+13
-4
13 additions, 4 deletions
common/run-aa-test
common/run-test-in-systemd
+1
-1
1 addition, 1 deletion
common/run-test-in-systemd
common/update-test-path
+4
-4
4 additions, 4 deletions
common/update-test-path
with
32 additions
and
11 deletions
common/common-subtree.sh
+
14
−
2
View file @
abf6fbd1
...
...
@@ -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
This diff is collapsed.
Click to expand it.
common/run-aa-test
+
13
−
4
View file @
abf6fbd1
...
...
@@ -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
"%
0
d"
"/^
${
ALTERNATIVE_SEPARATOR
}
$/
"
{
*
}
# Old versions of csplit don't provide "--suppress-matched", strip separator separately
for
FILE
in
${
TMP_DIR
}
/EXPECT
*
;
do
...
...
This diff is collapsed.
Click to expand it.
common/run-test-in-systemd
+
1
−
1
View file @
abf6fbd1
...
...
@@ -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
}
"
...
...
This diff is collapsed.
Click to expand it.
common/update-test-path
+
4
−
4
View file @
abf6fbd1
...
...
@@ -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
:-}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment