blob: 7c8c5648d7b9e170368ec5b5996caa1feba0fb32 [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"
Adrian Villin5d171eb2024-06-17 08:51:27 +02008 "strings"
Filip Tehlarbb98aac2022-12-21 14:40:35 +01009 "testing"
Adrian Villin93974e22024-05-30 06:10:59 -040010 "time"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000011
Adrian Villin4677d922024-06-14 09:32:39 +020012 . "fd.io/hs-test/infra"
Adrian Villincee15aa2024-03-14 11:42:55 -040013 . "github.com/onsi/ginkgo/v2"
14 . "github.com/onsi/gomega"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000015)
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 Villin4677d922024-06-14 09:32:39 +020023 if *IsVppDebug {
Adrian Villin93974e22024-05-30 06:10:59 -040024 // 30 minute timeout so that the framework won't timeout while debugging
Adrian Villin4677d922024-06-14 09:32:39 +020025 SuiteTimeout = time.Minute * 30
Adrian Villin93974e22024-05-30 06:10:59 -040026 } else {
Adrian Villin4677d922024-06-14 09:32:39 +020027 SuiteTimeout = time.Minute * 5
Adrian Villin93974e22024-05-30 06:10:59 -040028 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020029
Adrian Villin5d171eb2024-06-17 08:51:27 +020030 output, err := os.ReadFile("/sys/devices/system/node/online")
31 fmt.Println(string(output))
32 if err == nil && strings.Contains(string(output), "-") {
33 NumaAwareCpuAlloc = true
34 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020035 // creates a file with PPID, used for 'make cleanup-hst'
36 ppid := fmt.Sprint(os.Getppid())
37 ppid = ppid[:len(ppid)-1]
38 f, _ := os.Create(".last_hst_ppid")
39 f.Write([]byte(ppid))
40 f.Close()
41
Adrian Villincee15aa2024-03-14 11:42:55 -040042 RegisterFailHandler(Fail)
43 RunSpecs(t, "HST")
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010044}