Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 1 | package main |
| 2 | |
| 3 | import ( |
Adrian Villin | 7d1e4a4 | 2024-06-13 08:59:58 +0200 | [diff] [blame^] | 4 | "fmt" |
| 5 | "os" |
Adrian Villin | 681ff3a | 2024-06-07 06:45:48 -0400 | [diff] [blame] | 6 | "path/filepath" |
| 7 | "runtime" |
Filip Tehlar | bb98aac | 2022-12-21 14:40:35 +0100 | [diff] [blame] | 8 | "testing" |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 9 | "time" |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 10 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 11 | . "github.com/onsi/ginkgo/v2" |
| 12 | . "github.com/onsi/gomega" |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 13 | ) |
| 14 | |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 15 | var suiteTimeout time.Duration |
| 16 | |
Adrian Villin | 681ff3a | 2024-06-07 06:45:48 -0400 | [diff] [blame] | 17 | func getTestFilename() string { |
| 18 | _, filename, _, _ := runtime.Caller(2) |
| 19 | return filepath.Base(filename) |
| 20 | } |
| 21 | |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 22 | func TestHst(t *testing.T) { |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 23 | 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 Villin | 7d1e4a4 | 2024-06-13 08:59:58 +0200 | [diff] [blame^] | 29 | |
| 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 Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 37 | RegisterFailHandler(Fail) |
| 38 | RunSpecs(t, "HST") |
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 39 | } |