test: Verify and log iso version in iso_test.go

Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
pull/21821/head
Byounguk Lee 2025-10-29 11:14:26 +00:00
parent c3c7ac9b3b
commit 2f420fc029
1 changed files with 18 additions and 0 deletions

View File

@ -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)
}
})
}