1
0

Treat test files as relative to build directory

This commit is contained in:
dump_stack() 2023-02-27 18:28:10 +00:00
parent b0587a4ade
commit 870fe202b7
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -36,6 +36,7 @@ type DebugCmd struct {
NoKpti bool `help:"Disable KPTI"`
}
// TODO: merge with pew.go
func (cmd *DebugCmd) Run(g *Globals) (err error) {
kcfg, err := config.ReadKernelConfig(g.Config.Kernels)
if err != nil {
@ -161,7 +162,7 @@ func (cmd *DebugCmd) Run(g *Globals) (err error) {
return
}
_, outFile, output, err := build(tmp, ka, ki, g.Config.Docker.Timeout.Duration)
buildDir, outFile, output, err := build(tmp, ka, ki, g.Config.Docker.Timeout.Duration)
if err != nil {
log.Println(err, output)
return
@ -179,6 +180,9 @@ func (cmd *DebugCmd) Run(g *Globals) (err error) {
// Copy all test files to the remote machine
for _, f := range ka.TestFiles {
if f.Local[0] != '/' {
f.Local = buildDir + "/" + f.Local
}
err = q.CopyFile(f.User, f.Local, f.Remote)
if err != nil {
log.Println("error copy err:", err, f.Local, f.Remote)