Skip to content

Commit

Permalink
kola: Shorten TPM test name to keep the socket path under the limit
Browse files Browse the repository at this point in the history
The TPM directory is created under the _kola_temp folder for the VM. In
total the path used for the swtpm socket was above the 108 char limit
for some tests.
Shorten the affected test names to keep the socket path under the limit.
  • Loading branch information
pothos committed Apr 15, 2024
1 parent d34ff9a commit b30ae0a
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 b30ae0a

Please sign in to comment.