Skip to content

Commit b56a4cc

Browse files
committed
fixing bugs around the build feature
image to build in the tests is also moved to Fedora 38 as the Fedora 39 file doesn't work at the time of writing Signed-off-by: Kilian Hanich <[email protected]>
1 parent 6e58a0d commit b56a4cc

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

src/pkg/shell/shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func RunContext(ctx context.Context, name string, stdin io.Reader, stdout, stder
3939
return err
4040
}
4141
if exitCode != 0 {
42-
return fmt.Errorf("failed to invoke %s(1)", name)
42+
return fmt.Errorf("failed to invoke %s(%d)", name, exitCode)
4343
}
4444
return nil
4545
}

test/system/101-create.bats

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,13 @@ teardown() {
843843
}
844844

845845
@test "create: Build an image before creating the toolbox" {
846-
local build_context="./images/fedora/f39"
846+
local build_context="./images/fedora/f38"
847847

848848
run "$TOOLBX" create --build "$build_context"
849-
assert_success
849+
if [ "$status" -ne 0 ]
850+
then
851+
echo "$output"
852+
fi
850853

851854
assert_line --index 0 "Created container: fedora-toolbox"
852855
assert_line --index 1 "Enter with: toolbox enter fedora-toolbox"
@@ -858,33 +861,34 @@ teardown() {
858861
}
859862

860863
@test "create: Build an image and tag it before creating the toolbox without repository" {
861-
local build_context="./images/fedora/f39"
864+
local build_context="./images/fedora/f38"
862865
local build_tag="testbuild"
863866

864-
run "$TOOLBX" create --build "&build_context" --build-tag "testbuild"
867+
run "$TOOLBX" create --build "$build_context" --build-tag "$build_tag"
865868
assert_success
866869

867-
assert_line --index 0 "Created container: testbuild"
868-
assert_line --index 1 "Enter with: toolbox enter testbuild"
869-
assert [ ${#lines[q]} -eq 2 ]
870+
assert_line --index 0 "Created container: $build_tag"
871+
assert_line --index 1 "Enter with: toolbox enter $build_tag"
872+
assert [ ${#lines[@]} -eq 2 ]
870873

871-
run $PODMAN images --filter reference=localhost/testbuild
874+
run $PODMAN images --filter reference="localhost/$build_tag"
872875
assert_success
873876
assert [ ${#lines[@]} -eq 2 ]
874877
}
875878

876879
@test "create: Build an image and tag it before creating the toolbox with repository" {
877-
local build_context="./images/fedora/f39"
878-
local build_tag="registry.fedoraproject.org/testbuild"
880+
local build_context="./images/fedora/f38"
881+
local tag_repository="registry.fedoraproject.org"
882+
local build_tag="testbuild"
879883

880-
run "$TOOLBX" create --build "&build_context" --build-tag "testbuild"
884+
run "$TOOLBX" create --build "$build_context" --build-tag "$tag_repository/$build_tag"
881885
assert_success
882886

883-
assert_line --index 0 "Created container: testbuild"
884-
assert_line --index 1 "Enter with: toolbox enter testbuild"
885-
assert [ ${#lines[q]} -eq 2 ]
887+
assert_line --index 0 "Created container: $build_tag"
888+
assert_line --index 1 "Enter with: toolbox enter $build_tag"
889+
assert [ ${#lines[@]} -eq 2 ]
886890

887-
run $PODMAN images --filter reference="$build_tag"
891+
run $PODMAN images --filter reference="$tag_repository/$build_tag"
888892
assert_success
889893
assert [ ${#lines[@]} -eq 2 ]
890894
}

0 commit comments

Comments
 (0)