test: Verify and log iso version in iso_test.go
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>pull/21821/head
parent
c3c7ac9b3b
commit
2f420fc029
|
|
@ -20,6 +20,7 @@ package integration
|
|||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
|
|
@ -99,4 +100,21 @@ func TestISOImage(t *testing.T) {
|
|||
})
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("VersionJSON", func(t *testing.T) {
|
||||
rr, err := Run(t, exec.CommandContext(ctx, Target(), "-p", profile, "ssh", "cat /version.json"))
|
||||
if err != nil {
|
||||
t.Fatalf("failed to read /version.json. args %q: %v", rr.Command(), err)
|
||||
}
|
||||
|
||||
var data map[string]string
|
||||
if err := json.Unmarshal(rr.Stdout.Bytes(), &data); err != nil {
|
||||
t.Fatalf("failed to parse /version.json as JSON: %v. \nContent: %s", err, rr.Stdout)
|
||||
}
|
||||
|
||||
t.Logf("Successfully parsed /version.json:")
|
||||
for k, v := range data {
|
||||
t.Logf(" %s: %s", k, v)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue