-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmonitor_test.go
More file actions
48 lines (38 loc) · 985 Bytes
/
monitor_test.go
File metadata and controls
48 lines (38 loc) · 985 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
package qcli
import "testing"
var (
deviceMonitorString = "-monitor chardev:char0"
deviceMonitorSerialMuxString = "-monitor chardev:char0 -serial chardev:char0 -chardev stdio,id=char0,mux=on,signal=off"
deviceMonitorSocketString = "-monitor unix:/tmp/mon.sock,server=on,wait=off"
)
func TestAppendMonitor(t *testing.T) {
mon := MonitorDevice{
ChardevID: "char0",
}
testAppend(mon, deviceMonitorString, t)
}
func TestAppendMonitorSerialMux(t *testing.T) {
cdev := CharDevice{
Driver: LegacySerial,
Backend: Stdio,
ID: "char0",
Mux: "on",
Signal: "off",
}
serial := LegacySerialDevice{
ChardevID: "char0",
}
mon := MonitorDevice{
ChardevID: "char0",
}
c := &Config{}
c.devices = []Device{mon, serial, cdev}
testConfig(c, deviceMonitorSerialMuxString, t)
}
func TestAppendMonitorSocket(t *testing.T) {
mon := MonitorDevice{
Backend: Socket,
Path: "/tmp/mon.sock",
}
testAppend(mon, deviceMonitorSocketString, t)
}