[CI:DOCS] Machine test timeout env var

Introduce MACHINE_TEST_TIMEOUT, which sets the timeout for machine tests, in seconds.

Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
Ashley Cui 2023-11-15 15:58:11 -05:00
parent fcf4f33277
commit 3d88f614f7
1 changed files with 8 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"time"
@ -100,6 +101,13 @@ func newMB() (*machineTestBuilder, error) {
if os.Getenv("PODMAN_BINARY") != "" {
mb.podmanBinary = os.Getenv("PODMAN_BINARY")
}
if os.Getenv("MACHINE_TEST_TIMEOUT") != "" {
seconds, err := strconv.Atoi(os.Getenv("MACHINE_TEST_TIMEOUT"))
if err != nil {
return nil, err
}
mb.timeout = time.Duration(seconds) * time.Second
}
return &mb, nil
}