blob: b992659a4afeb0d4a54db48ac10937d53bb6627d [file] [log] [blame]
Filip Tehlar229f5fc2022-08-09 14:44:47 +00001package main
2
3import (
Adrian Villin7d1e4a42024-06-13 08:59:58 +02004 "fmt"
5 "os"
Adrian Villin681ff3a2024-06-07 06:45:48 -04006 "path/filepath"
7 "runtime"
Filip Tehlarbb98aac2022-12-21 14:40:35 +01008 "testing"
Adrian Villin93974e22024-05-30 06:10:59 -04009 "time"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000010
Adrian Villincee15aa2024-03-14 11:42:55 -040011 . "github.com/onsi/ginkgo/v2"
12 . "github.com/onsi/gomega"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000013)
14
Adrian Villin93974e22024-05-30 06:10:59 -040015var suiteTimeout time.Duration
16
Adrian Villin681ff3a2024-06-07 06:45:48 -040017func getTestFilename() string {
18 _, filename, _, _ := runtime.Caller(2)
19 return filepath.Base(filename)
20}
21
Adrian Villincee15aa2024-03-14 11:42:55 -040022func TestHst(t *testing.T) {
Adrian Villin93974e22024-05-30 06:10:59 -040023 if *isVppDebug {
24 // 30 minute timeout so that the framework won't timeout while debugging
25 suiteTimeout = time.Minute * 30
26 } else {
27 suiteTimeout = time.Minute * 5
28 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020029
30 // creates a file with PPID, used for 'make cleanup-hst'
31 ppid := fmt.Sprint(os.Getppid())
32 ppid = ppid[:len(ppid)-1]
33 f, _ := os.Create(".last_hst_ppid")
34 f.Write([]byte(ppid))
35 f.Close()
36
Adrian Villincee15aa2024-03-14 11:42:55 -040037 RegisterFailHandler(Fail)
38 RunSpecs(t, "HST")
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010039}