Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make device-required tests independent of tests that don't use a device #37

Merged
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
28 changes: 26 additions & 2 deletions tests/integration/testcases/build.bats
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,33 @@ teardown_file() {
requires-image-version "$DEFAULT_TEZI_IMAGE" "5.3.0"
requires-device

# This test case assumes the previous one was executed.
local COMMIT='my-dev-branch'
local OUTDIR='fully_customized_image'
run torizoncore-builder build \
--file "$SAMPLES_DIR/config/tcbuild-full-customization.yaml" \
--set INPUT_IMAGE="$DEFAULT_TEZI_IMAGE" \
--set OUTPUT_DIR="$OUTDIR" --force

assert_success
assert_output --partial 'splash screen merged'
assert_output --partial 'Overlay sample_overlay.dtbo successfully applied.'
assert_output --partial 'Overlay custom-kargs_overlay.dtbo successfully applied.'
assert_output --partial \
'Kernel custom arguments successfully configured with "key1=val1 key2=val2".'
assert_output --partial 'Deploying commit ref: my-dev-branch'

local ARCHIVE='/storage/ostree-archive/'
local COMMIT='my-dev-branch'

# Check output/easy-installer/{name,description,licence,release-notes}:
run cat "$OUTDIR/image.json"
assert_output --partial '"name": "fully-customized image"'
assert_output --partial '"description": "fully-customized image description"'
assert_output --partial '"license": "license-fc.html"'
assert_output --partial '"releasenotes": "release-notes-fc.html"'

# Check presence of container:
run [ -e "$OUTDIR/docker-storage.tar.xz" -a -e "$OUTDIR/docker-compose.yml" ]
assert_success

# Deploy custom image.
run torizoncore-builder deploy --remote-host "$DEVICE_ADDR" \
Expand Down
1 change: 1 addition & 0 deletions tests/integration/testcases/dt.bats
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ load 'lib/common.bash'
@test "dt: deploy device tree in the device" {
requires-device
torizoncore-builder-shell "rm -rf device-trees"
torizoncore-builder images --remove-storage unpack $DEFAULT_TEZI_IMAGE

run torizoncore-builder dt checkout --update
if is-major-version-greater-than-5; then
Expand Down
22 changes: 22 additions & 0 deletions tests/integration/testcases/dto.bats
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ bats_load_library 'bats/bats-file/load.bash'
run device-shell "cat /proc/device-tree/tcb_prop_test"
assert_failure 1

torizoncore-builder images --remove-storage unpack $DEFAULT_TEZI_IMAGE
torizoncore-builder dto apply --force $SAMPLES_DIR/dts/sample_overlay.dts
torizoncore-builder union branch1
run torizoncore-builder deploy \
--remote-host $DEVICE_ADDR --remote-username $DEVICE_USER \
Expand Down Expand Up @@ -134,6 +136,26 @@ bats_load_library 'bats/bats-file/load.bash'
@test "dto: remove overlay from the device" {
requires-device

# This test assumes that sample_overlay.dtbo is already
# present and used in the device
run device-shell "cat /proc/device-tree/tcb_prop_test"
assert_success
assert_output --partial "tcb_prop_value"

# Recreate image with overlay
torizoncore-builder images --remove-storage unpack $DEFAULT_TEZI_IMAGE
torizoncore-builder dto apply --force $SAMPLES_DIR/dts/sample_overlay.dts
run torizoncore-builder dto status
assert_success
assert_output --partial "sample_overlay.dtbo"

run torizoncore-builder dto remove sample_overlay.dtbo
assert_success

run torizoncore-builder dto status
assert_success
refute_output --partial "sample_overlay.dtbo"

torizoncore-builder union branch2
run torizoncore-builder deploy \
--remote-host $DEVICE_ADDR --remote-username $DEVICE_USER \
Expand Down
Loading