-
Notifications
You must be signed in to change notification settings - Fork 11
/
qhost_test.go
35 lines (26 loc) · 1.21 KB
/
qhost_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package libdrmaa_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/dgruber/drmaa2interface"
. "github.com/dgruber/drmaa2os/pkg/jobtracker/libdrmaa"
)
var _ = Describe("Qhost", func() {
Context("", func() {
It("should return the machine list", func() {
out := `HOSTNAME ARCH NCPU NSOC NCOR NTHR LOAD MEMTOT MEMUSE SWAPTO SWAPUS
----------------------------------------------------------------------------------------------
global - - - - - - - - - -
master lx-amd64 8 2 8 8 0.25 1.9G 334.9M 1024.0M 174.0M`
hosts := ParseQhostForHostnames(out)
Expect(len(hosts)).To(BeNumerically("==", 1))
Expect(hosts[0].Name).To(Equal("master"))
Expect(hosts[0].Architecture.String()).To(Equal(drmaa2interface.IA64.String()))
Expect(hosts[0].OS.String()).To(Equal(drmaa2interface.Linux.String()))
Expect(hosts[0].Sockets).To(BeNumerically("==", 2))
Expect(hosts[0].CoresPerSocket).To(BeNumerically("==", 4))
Expect(hosts[0].ThreadsPerCore).To(BeNumerically("==", 1))
Expect(hosts[0].Load).To(BeNumerically("~", 0.24, 0.26))
})
})
})