forked from containers/bootc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request containers#669 from cgwalters/fix-selinux
store: Use policy from merged tree with derived layers
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,24 @@ jobs: | |
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli | ||
- name: Integration tests | ||
run: ./ci/priv-integration.sh | ||
privtest-cockpit: | ||
name: "Privileged testing (cockpit)" | ||
needs: build | ||
runs-on: ubuntu-latest | ||
container: | ||
image: quay.io/fedora/fedora-bootc:41 | ||
options: "--privileged --pid=host -v /var/tmp:/var/tmp -v /run/dbus:/run/dbus -v /run/systemd:/run/systemd -v /:/run/host" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Download | ||
uses: actions/[email protected] | ||
with: | ||
name: ostree-ext-cli | ||
- name: Install | ||
run: install ostree-ext-cli /usr/bin && rm -v ostree-ext-cli | ||
- name: Integration tests | ||
run: ./ci/priv-test-cockpit-selinux.sh | ||
container-build: | ||
name: "Container build" | ||
needs: build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# Assumes that the current environment is a privileged container | ||
# with the host mounted at /run/host. We can basically write | ||
# whatever we want, however we can't actually *reboot* the host. | ||
set -euo pipefail | ||
|
||
sysroot=/run/host | ||
stateroot=test-cockpit | ||
repo=$sysroot/ostree/repo | ||
image=registry.gitlab.com/fedora/bootc/tests/container-fixtures/cockpit | ||
imgref=ostree-unverified-registry:${image} | ||
|
||
cd $(mktemp -d -p /var/tmp) | ||
|
||
set -x | ||
|
||
if test '!' -e "${sysroot}/ostree"; then | ||
ostree admin init-fs --epoch=1 "${sysroot}" | ||
ostree config --repo $repo set sysroot.bootloader none | ||
fi | ||
ostree admin stateroot-init "${stateroot}" --sysroot "${sysroot}" | ||
ostree-ext-cli container image deploy --sysroot "${sysroot}" \ | ||
--stateroot "${stateroot}" --imgref "${imgref}" | ||
ref=$(ostree refs --repo $repo ostree/container/image | head -1) | ||
commit=$(ostree rev-parse --repo $repo ostree/container/image/$ref) | ||
ostree ls --repo $repo -X ${commit} /usr/lib/systemd/system|grep -i cockpit >out.txt | ||
if ! grep -q :cockpit_unit_file_t:s0 out.txt; then | ||
echo "failed to find cockpit_unit_file_t" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
echo ok "derived selinux" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters