Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions cmd/amd-ctk/cdi/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package generate

import (
"fmt"
"os/user"
"path/filepath"
"strings"

Expand Down Expand Up @@ -63,11 +62,6 @@ func AddNewCommand() *cli.Command {
}

func validateGenOptions(c *cli.Context, genOptions *generateOptions) error {
curUser, err := user.Current()
if err != nil || curUser.Uid != "0" {
return fmt.Errorf("Permission denied: Not running as root")
}

out, err := filepath.Abs(genOptions.output)
if err != nil {
return fmt.Errorf("incorrect output file, Err: %v", err)
Expand Down
6 changes: 0 additions & 6 deletions cmd/amd-ctk/cdi/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package validate

import (
"fmt"
"os/user"
"path/filepath"
"strings"

Expand Down Expand Up @@ -63,11 +62,6 @@ func AddNewCommand() *cli.Command {
}

func validateValOptions(c *cli.Context, valOptions *validateOptions) error {
curUser, err := user.Current()
if err != nil || curUser.Uid != "0" {
return fmt.Errorf("Permission denied: Not running as root")
}

out, err := filepath.Abs(valOptions.cdiSpecPath)
if err != nil {
return fmt.Errorf("Incorrect CDI spec file, Error: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion internal/cdi/cdi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestInterface(t *testing.T) {
err := cdi.GenerateSpec()
Assert(t, err == nil, fmt.Sprintf("failed to generate cdi spec, Err: %v", err))

cdi.specPath = "/tmp/"
cdi.specPath = t.TempDir() + "/amd.json"
err = cdi.WriteSpec()
Assert(t, err == nil, fmt.Sprintf("WriteSpec() returned error %v", err))

Expand Down