blob: a086f75a5fca35936278b07f227966fe880479d4 [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"
Filip Tehlarbb98aac2022-12-21 14:40:35 +01008 "testing"
Adrian Villin93974e22024-05-30 06:10:59 -04009 "time"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000010
Adrian Villin4677d922024-06-14 09:32:39 +020011 . "fd.io/hs-test/infra"
Adrian Villincee15aa2024-03-14 11:42:55 -040012 . "github.com/onsi/ginkgo/v2"
13 . "github.com/onsi/gomega"
Filip Tehlar229f5fc2022-08-09 14:44:47 +000014)
15
Adrian Villin681ff3a2024-06-07 06:45:48 -040016func getTestFilename() string {
17 _, filename, _, _ := runtime.Caller(2)
18 return filepath.Base(filename)
19}
20
Adrian Villincee15aa2024-03-14 11:42:55 -040021func TestHst(t *testing.T) {
Adrian Villin4677d922024-06-14 09:32:39 +020022 if *IsVppDebug {
Adrian Villin93974e22024-05-30 06:10:59 -040023 // 30 minute timeout so that the framework won't timeout while debugging
Adrian Villin4677d922024-06-14 09:32:39 +020024 SuiteTimeout = time.Minute * 30
Adrian Villin93974e22024-05-30 06:10:59 -040025 } else {
Adrian Villin4677d922024-06-14 09:32:39 +020026 SuiteTimeout = time.Minute * 5
Adrian Villin93974e22024-05-30 06:10:59 -040027 }
Adrian Villin7d1e4a42024-06-13 08:59:58 +020028
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 Villincee15aa2024-03-14 11:42:55 -040036 RegisterFailHandler(Fail)
37 RunSpecs(t, "HST")
Maros Ondrejickac2f76f42023-02-27 13:22:45 +010038}