blob: 91cb1032bba4c083a97e247aebb246f7835597a9 [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 Villin5d171eb2024-06-17 08:51:27 +02006 "strings"
Filip Tehlarbb98aac2022-12-21 14:40:35 +01007 "testing"
Adrian Villin93974e22024-05-30 06:10:59 -04008 "time"
Filip Tehlar229f5fc2022-08-09 14:44:47 +00009
Adrian Villin4677d922024-06-14 09:32:39 +020010 . "fd.io/hs-test/infra"
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 Villincee15aa2024-03-14 11:42:55 -040015func TestHst(t *testing.T) {
Adrian Villin4677d922024-06-14 09:32:39 +020016 if *IsVppDebug {
Adrian Villin93974e22024-05-30 06:10:59 -040017 // 30 minute timeout so that the framework won't timeout while debugging
Adrian Villin4677d922024-06-14 09:32:39 +020018 SuiteTimeout = time.Minute * 30
Adrian Villin93974e22024-05-30 06:10:59 -040019 } else {
Adrian Villin4677d922024-06-14 09:32:39 +020020 SuiteTimeout = time.Minute * 5
Adrian Villin93974e22024-05-30 06:10:59 -040021 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020022
Adrian Villin5d171eb2024-06-17 08:51:27 +020023 output, err := os.ReadFile("/sys/devices/system/node/online")
Adrian Villin5d171eb2024-06-17 08:51:27 +020024 if err == nil && strings.Contains(string(output), "-") {
25 NumaAwareCpuAlloc = true
26 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020027 // 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 Villincee15aa2024-03-14 11:42:55 -040034 RegisterFailHandler(Fail)
35 RunSpecs(t, "HST")
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010036}