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 | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 11 | . "fd.io/hs-test/infra" |
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 12 | . "github.com/onsi/ginkgo/v2" |
13 | . "github.com/onsi/gomega" | ||||
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 14 | ) |
15 | |||||
Adrian Villin | 681ff3a | 2024-06-07 06:45:48 -0400 | [diff] [blame] | 16 | func getTestFilename() string { |
17 | _, filename, _, _ := runtime.Caller(2) | ||||
18 | return filepath.Base(filename) | ||||
19 | } | ||||
20 | |||||
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 21 | func TestHst(t *testing.T) { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 22 | if *IsVppDebug { |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 23 | // 30 minute timeout so that the framework won't timeout while debugging |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 24 | SuiteTimeout = time.Minute * 30 |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 25 | } else { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 26 | SuiteTimeout = time.Minute * 5 |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 27 | } |
Adrian Villin | 7d1e4a4 | 2024-06-13 08:59:58 +0200 | [diff] [blame] | 28 | |
29 | // creates a file with PPID, used for 'make cleanup-hst' | ||||
30 | ppid := fmt.Sprint(os.Getppid()) | ||||
31 | ppid = ppid[:len(ppid)-1] | ||||
32 | f, _ := os.Create(".last_hst_ppid") | ||||
33 | f.Write([]byte(ppid)) | ||||
34 | f.Close() | ||||
35 | |||||
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 36 | RegisterFailHandler(Fail) |
37 | RunSpecs(t, "HST") | ||||
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 38 | } |