Browse Source

adding TestFiles to artifact config, transfers extra test files to VM

master
Bradley Landherr 4 months ago
parent
commit
e43993c6e5
3 changed files with 26 additions and 0 deletions
  1. 8
    0
      config/config.go
  2. 9
    0
      debug.go
  3. 9
    0
      pew.go

+ 8
- 0
config/config.go View File

@@ -108,10 +108,18 @@ type PreloadModule struct {
TimeoutAfterLoad Duration
}

// Extra test files to copy over
type FileTransfer struct {
User string
Local string
Remote string
}

// Artifact is for .out-of-tree.toml
type Artifact struct {
Name string
Type ArtifactType
TestFiles []FileTransfer
SourcePath string
SupportedKernels []KernelMask


+ 9
- 0
debug.go View File

@@ -201,6 +201,15 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
return
}

// Copy all test files to the remote machine
for _,f := range ka.TestFiles {
err = q.CopyFile(f.User,f.Local,f.Remote)
if err != nil {
log.Println("error copy err:", err, f.Local, f.Remote)
return
}
}

coloredRemoteFile := aurora.BgGreen(aurora.Black(remoteFile))
fmt.Printf("[*] build result copied to %s\n", coloredRemoteFile)


+ 9
- 0
pew.go View File

@@ -251,6 +251,15 @@ func copyArtifactAndTest(q *qemu.System, ka config.Artifact,
}
res.Run.Ok = true

// Copy all test files to the remote machine
for _,f := range ka.TestFiles {
err = q.CopyFile(f.User,f.Local,f.Remote)
if err != nil {
log.Println("error copy err:", err, f.Local, f.Remote)
return
}
}

res.Test.Output, err = testKernelModule(q, ka, remoteTest)
if err != nil {
log.Println(res.Test.Output, err)

Loading…
Cancel
Save