Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/boot-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ never() { return 1; }
[[ $output == *"lxc.net.0.type = veth"* ]]
}

@test "lxc_config: asks for the apparmor profile a unit with a namespace needs" {
output=$(bt_lxc_config keel-nodebb-boot-test /var/lib/lxc/keel-nodebb-boot-test/rootfs br0)
[[ $output == *"lxc.apparmor.profile = generated"* ]]
[[ $output == *"lxc.apparmor.allow_nesting = 1"* ]]
}

@test "spec_targets: both paths the first boot reads, under the rootfs" {
output=$(bt_spec_targets /r)
[ "$output" = $'/r/etc/keel/instance.yaml\n/r/etc/inithooks.yaml' ]
Expand Down
10 changes: 10 additions & 0 deletions tests/lib/boot-test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,21 @@ bt_lxc_config() {
# bt_lxc_config NAME ROOTFS BRIDGE: an LXC config for a plain rootfs
# directory on a bridge; the address comes from the bridge (SLAAC or
# DHCPv6), the spec declares managed_by: host.
#
# The apparmor pair is not decoration. Under the stock container profile
# a unit that asks systemd for a mount namespace is refused, and
# redis-server.service asks: it fails with status=226/NAMESPACE, so
# firstboot.d/40nodebb never reaches Redis and the forum never starts. A
# generated profile with nesting allowed is what a container running
# systemd needs, and it is what the appliance containers on the build
# host have carried all along.
cat <<CONFIG
lxc.uts.name = $1
lxc.rootfs.path = dir:$2
lxc.include = /usr/share/lxc/config/common.conf
lxc.arch = amd64
lxc.apparmor.profile = generated
lxc.apparmor.allow_nesting = 1
lxc.net.0.type = veth
lxc.net.0.link = $3
lxc.net.0.name = eth0
Expand Down
Loading