1
0

Implements the parameter to specify an endless stress script

This commit is contained in:
2023-05-08 22:01:10 +00:00
parent ca95155ce0
commit 3677adece9
2 changed files with 22 additions and 0 deletions

View File

@ -550,6 +550,17 @@ func (q *System) CopyAndRun(user, path string) (output string, err error) {
return q.Command(user, "chmod +x "+remotePath+" && "+remotePath)
}
// CopyAndRunAsync is copy local file to qemu vm then run it w/o wait for exit
func (q *System) CopyAndRunAsync(user, path string) (err error) {
remotePath := fmt.Sprintf("/tmp/executable_%d", rand.Int())
err = q.CopyFile(user, path, remotePath)
if err != nil {
return
}
return q.AsyncCommand(user, "chmod +x "+remotePath+" && "+remotePath)
}
// Debug is for enable qemu debug and set hostname and port for listen
func (q *System) Debug(conn string) {
q.debug = true