Add Reboot and Reset methods (#37)
This commit is contained in:
committed by
Ben LeMasurier
parent
208ef2aff1
commit
c09ce7b21d
@@ -369,6 +369,16 @@ var testShutdownReply = []byte{
|
||||
0x00, 0x00, 0x00, 0x00, // status
|
||||
}
|
||||
|
||||
var testRebootReply = []byte{
|
||||
0x00, 0x00, 0x00, 0x1c, // length
|
||||
0x20, 0x00, 0x80, 0x86, // program
|
||||
0x00, 0x00, 0x00, 0x01, // version
|
||||
0x00, 0x00, 0x00, 0xea, // procedure
|
||||
0x00, 0x00, 0x00, 0x01, // type
|
||||
0x00, 0x00, 0x00, 0x00, // serial
|
||||
0x00, 0x00, 0x00, 0x00, // status
|
||||
}
|
||||
|
||||
// MockLibvirt provides a mock libvirt server for testing.
|
||||
type MockLibvirt struct {
|
||||
net.Conn
|
||||
@@ -446,6 +456,10 @@ func (m *MockLibvirt) handleRemote(procedure uint32, conn net.Conn) {
|
||||
conn.Write(m.reply(testDestroyReply))
|
||||
case constants.ProcDomainDefineXMLFlags:
|
||||
conn.Write(m.reply(testDefineXML))
|
||||
case constants.ProcDomainReboot:
|
||||
conn.Write(m.reply(testRebootReply))
|
||||
case constants.ProcDomainReset:
|
||||
conn.Write(m.reply(testRebootReply))
|
||||
case constants.ProcDomainCreateWithFlags:
|
||||
conn.Write(m.reply(testCreateWithFlags))
|
||||
case constants.ProcDomainShutdownFlags:
|
||||
|
||||
Reference in New Issue
Block a user