add simple integration tests

Add simple integration tests and integrate them into the CI.
More complex tests will be added later.

Fixes: #15
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg 2019-09-11 11:13:02 +02:00
parent 270e07a34a
commit 07b19327a1
3 changed files with 44 additions and 4 deletions

24
test/simple.bats Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bats -t
@test "Help" {
run $CTR_ENGINE run --rm $CTR_IMAGE -h
[ "$status" -eq 1 ]
#TODO: we should exit 0
[[ ${lines[0]} =~ "BuildSourceImage.sh version " ]]
[[ ${lines[1]} =~ "Usage: BuildSourceImage.sh " ]]
}
@test "Version" {
run $CTR_ENGINE run --rm $CTR_IMAGE -v
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ "BuildSourceImage.sh version " ]]
}
@test "List Drivers" {
run $CTR_ENGINE run --rm $CTR_IMAGE -l
[ "$status" -eq 0 ]
[[ ${lines[0]} =~ "sourcedriver_context_dir" ]]
[[ ${lines[1]} =~ "sourcedriver_extra_src_dir" ]]
[[ ${lines[2]} =~ "sourcedriver_rpm_dir" ]]
[[ ${lines[3]} =~ "sourcedriver_rpm_fetch" ]]
}