Skip to content

Commit

Permalink
Merge branch 'master' into cli-wrap
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebon authored Apr 15, 2020
2 parents d45f12b + d1a4277 commit 21819ab
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 46 deletions.
6 changes: 5 additions & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ Testing
You can use `make check` in a container to run the unit tests. However,
if you want to test the daemon in a useful way, you'll need virtualization.

There's a `make vmcheck` test suite that requires a `ssh-config` in the
rpm-ostree has some tests that use the [coreos-assembler/kola framework](https://github.com/coreos/coreos-assembler/blob/94602e26678fd1a8fa3bda37b3b1d980967be2d6/mantle/kola/README-kola-ext.md).

You will want to [build a custom image](https://github.com/coreos/coreos-assembler/blob/94602e26678fd1a8fa3bda37b3b1d980967be2d6/README-devel.md#using-overrides) and use `kola run -E /path/to/rpm-ostree.git ext.rpm-ostree.*'.

There's also a `make vmcheck` test suite that requires a `ssh-config` in the
source directory toplevel. You can provision a VM however you want; libvirt
directly, vagrant, a remote OpenStack/EC2 instance, etc. If you choose
vagrant for example, do something like this:
Expand Down
45 changes: 20 additions & 25 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/kola/nondestructive/data
25 changes: 25 additions & 0 deletions tests/kola/nondestructive/misc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail

. ${KOLA_EXT_DATA}/libtest-core.sh
cd $(mktemp -d)

# Verify operations as non-root
runuser -u core rpm-ostree status
echo "ok status doesn't require root"

# StateRoot is only in --verbose
rpm-ostree status > status.txt
assert_not_file_has_content status.txt StateRoot:
rpm-ostree status -v > status.txt
assert_file_has_content status.txt StateRoot:
echo "ok status text"

# Also check that we can do status as non-root non-active
runuser -u bin rpm-ostree status
echo "ok status doesn't require active PAM session"

rpm-ostree status -b > status.txt
assert_streq $(grep -F -e 'ostree://' status.txt | wc -l) "1"
assert_file_has_content status.txt BootedDeployment:
echo "ok status -b"
19 changes: 0 additions & 19 deletions tests/vmcheck/test-misc-1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,6 @@ vm_shell_inline > coreos-rootfs.txt << EOF
EOF
assert_file_has_content coreos-rootfs.txt '-*i-* /var/tmp/coreos-rootfs'

# Assert that we can do status as non-root
vm_cmd_as core rpm-ostree status
echo "ok status doesn't require root"

# StateRoot is only in --verbose
vm_rpmostree status > status.txt
assert_not_file_has_content status.txt StateRoot:
vm_rpmostree status -v > status.txt
assert_file_has_content status.txt StateRoot:
echo "ok status text"

# Also check that we can do status as non-root non-active
vm_cmd runuser -u bin rpm-ostree status
echo "ok status doesn't require active PAM session"

vm_rpmostree status -b > status.txt
assert_streq $(grep -F -e 'ostree://' status.txt | wc -l) "1"
assert_file_has_content status.txt BootedDeployment:
echo "ok status -b"

# Reload as root https://github.com/projectatomic/rpm-ostree/issues/976
vm_cmd rpm-ostree reload
Expand Down

0 comments on commit 21819ab

Please sign in to comment.