Skip to content

Commit

Permalink
Merge pull request #525 from flatcar/kai/tpmsocklen
Browse files Browse the repository at this point in the history
kola: Shorten TPM test name to keep the socket path under the limit
  • Loading branch information
pothos authored Apr 15, 2024
2 parents d34ff9a + b30ae0a commit 9af1d02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions kola/tests/misc/tpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,19 @@ func init() {
Run: runRootTPMCryptenroll,
ClusterSize: 0,
Platforms: []string{"qemu"},
Name: "cl.tpm.root-cryptenroll",
Name: "cl.tpm.root-ce",
Distros: []string{"cl"},
MinVersion: semver.Version{Major: 3913, Minor: 0, Patch: 1},
})
runRootTPMCryptenrollPcrNoUpdate := func(c cluster.TestCluster) {
tpmTest(c, IgnitionConfigRootCryptenrollPcrNoUpdate, "/", VariantNoUpdate)
}
// The test names are part of the UNIX socket path which is limited to 108 chars
register.Register(&register.Test{
Run: runRootTPMCryptenrollPcrNoUpdate,
ClusterSize: 0,
Platforms: []string{"qemu"},
Name: "cl.tpm.root-cryptenroll-pcr-noupdate",
Name: "cl.tpm.root-ce-pcr-noupd",
Distros: []string{"cl"},
MinVersion: semver.Version{Major: 3913, Minor: 0, Patch: 1},
})
Expand All @@ -274,7 +275,7 @@ func init() {
Run: runRootTPMCryptenrollPcrWithUpdate,
ClusterSize: 0,
Platforms: []string{"qemu"},
Name: "cl.tpm.root-cryptenroll-pcr-withupdate",
Name: "cl.tpm.root-ce-pcr-w-upd",
Distros: []string{"cl"},
MinVersion: semver.Version{Major: 3913, Minor: 0, Patch: 1},
})
Expand Down
2 changes: 1 addition & 1 deletion platform/local/tpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewSwtpm(dir string) (*SoftwareTPM, error) {

os.Mkdir(dir, 0700)
swtpm.dir = dir
swtpm.socketPath = fmt.Sprintf("%v/sock", swtpm.dir)
swtpm.socketPath = fmt.Sprintf("%v/sk", swtpm.dir)

swtpm.process = exec.Command("swtpm", "socket", "--tpmstate", fmt.Sprintf("dir=%v", swtpm.dir), "--ctrl", fmt.Sprintf("type=unixio,path=%v", swtpm.socketPath), "--tpm2")
out, err := swtpm.process.StderrPipe()
Expand Down

0 comments on commit 9af1d02

Please sign in to comment.