Skip to content

Commit

Permalink
Add logging; unit tests for UBI9 (#2191)
Browse files Browse the repository at this point in the history
* Add logging; unit tests for UBI9

* Address comments
  • Loading branch information
sebrandon1 authored Jun 25, 2024
1 parent 14f49ca commit cb5fe52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions cnf-certification-test/platform/isredhat/isredhat.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func NewBaseImageTester(client clientsholder.Command, ctx clientsholder.Context)

func (b *BaseImageInfo) TestContainerIsRedHatRelease() (bool, error) {
output, err := b.runCommand(`if [ -e /etc/redhat-release ]; then cat /etc/redhat-release; else echo \"Unknown Base Image\"; fi`)
log.Info("Output from /etc/redhat-release: %q", output)
if err != nil {
return false, err
}
Expand Down
7 changes: 7 additions & 0 deletions cnf-certification-test/platform/isredhat/isredhat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ func TestTestContainerIsRedHatRelease(t *testing.T) {
expectedResult: false,
expectedErr: errors.New("random error"),
},
{ // Test Case #4 - Add UBI9 output
resultStdOut: "Red Hat Enterprise Linux release 9.4 (Plow)",
resultStdErr: "",
resultErr: nil,
expectedResult: true,
expectedErr: nil,
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit cb5fe52

Please sign in to comment.