Skip to content

Commit a0b7e5c

Browse files
committed
Fixes #21815 test: Verify and log iso version in iso_test.go
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
1 parent c3c7ac9 commit a0b7e5c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/integration/iso_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ package integration
2020

2121
import (
2222
"context"
23+
"encoding/json"
2324
"fmt"
2425
"os/exec"
2526
"runtime"
@@ -99,4 +100,21 @@ func TestISOImage(t *testing.T) {
99100
})
100101
}
101102
})
103+
104+
t.Run("VersionJSON", func(t *testing.T) {
105+
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "cat /version.json"))
106+
if err != nil {
107+
t.Fatalf("failed to read /version.json. args %q: %v", rr.Command(), err)
108+
}
109+
110+
var data map[string]string
111+
if err := json.Unmarshal(rr.Stdout.Bytes(), &data); err != nil {
112+
t.Fatalf("failed to parse /version.json as JSON: %v. \nContent: %s", err, rr.Stdout)
113+
}
114+
115+
t.Logf("Successfully parsed /version.json:")
116+
for k, v := range data {
117+
t.Logf(" %s: %s", k, v)
118+
}
119+
})
102120
}

0 commit comments

Comments
 (0)