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 | 5d171eb | 2024-06-17 08:51:27 +0200 | [diff] [blame] | 6 | "strings" |
Filip Tehlar | bb98aac | 2022-12-21 14:40:35 +0100 | [diff] [blame] | 7 | "testing" |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 8 | "time" |
Filip Tehlar | 229f5fc | 2022-08-09 14:44:47 +0000 | [diff] [blame] | 9 | |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 10 | . "fd.io/hs-test/infra" |
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 | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 15 | func TestHst(t *testing.T) { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 16 | if *IsVppDebug { |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 17 | // 30 minute timeout so that the framework won't timeout while debugging |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 18 | SuiteTimeout = time.Minute * 30 |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 19 | } else { |
Adrian Villin | 4677d92 | 2024-06-14 09:32:39 +0200 | [diff] [blame] | 20 | SuiteTimeout = time.Minute * 5 |
Adrian Villin | 93974e2 | 2024-05-30 06:10:59 -0400 | [diff] [blame] | 21 | } |
Adrian Villin | 7d1e4a4 | 2024-06-13 08:59:58 +0200 | [diff] [blame] | 22 | |
Adrian Villin | 5d171eb | 2024-06-17 08:51:27 +0200 | [diff] [blame] | 23 | output, err := os.ReadFile("/sys/devices/system/node/online") |
Adrian Villin | 5d171eb | 2024-06-17 08:51:27 +0200 | [diff] [blame] | 24 | if err == nil && strings.Contains(string(output), "-") { |
25 | NumaAwareCpuAlloc = true | ||||
26 | } | ||||
Adrian Villin | 7d1e4a4 | 2024-06-13 08:59:58 +0200 | [diff] [blame] | 27 | // creates a file with PPID, used for 'make cleanup-hst' |
28 | ppid := fmt.Sprint(os.Getppid()) | ||||
29 | ppid = ppid[:len(ppid)-1] | ||||
30 | f, _ := os.Create(".last_hst_ppid") | ||||
31 | f.Write([]byte(ppid)) | ||||
32 | f.Close() | ||||
33 | |||||
Adrian Villin | cee15aa | 2024-03-14 11:42:55 -0400 | [diff] [blame] | 34 | RegisterFailHandler(Fail) |
35 | RunSpecs(t, "HST") | ||||
Maros Ondrejicka | c2f76f4 | 2023-02-27 13:22:45 +0100 | [diff] [blame] | 36 | } |