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#881 from ckyrouac/container-check
install: Check if running in container earlier
- Loading branch information
Showing
4 changed files
with
35 additions
and
2 deletions.
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
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
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,9 @@ | ||
provision: | ||
how: virtual | ||
# Generated by make test-tmt | ||
image: file://./target/testvm/disk.qcow2 | ||
disk: 20 | ||
summary: Execute tests for installing outside of a container | ||
execute: | ||
how: tmt | ||
script: exec nu tests/booted/test-install-outside-container.nu |
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,14 @@ | ||
use std assert | ||
use tap.nu | ||
|
||
# setup filesystem | ||
mkdir /var/mnt | ||
truncate -s 100M disk.img | ||
mkfs.ext4 disk.img | ||
mount -o loop disk.img /var/mnt | ||
|
||
# attempt to install to filesystem without specifying a source-imgref | ||
let result = bootc install to-filesystem /var/mnt e>| ansi strip | ||
assert equal $result "ERROR Installing to filesystem: Either --source-imgref must be defined or this command must be executed inside a podman container." | ||
|
||
tap ok |