MCPcopy Create free account
hub / github.com/digitalocean/go-libvirt / TestUsingAfterDisconnect

Function TestUsingAfterDisconnect

libvirt_integration_test.go:142–158  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestUsingAfterDisconnect(t *testing.T) {
143 l := NewWithDialer(testDialer(t))
144
145 if err := l.Connect(); err != nil {
146 t.Fatal(err)
147 }
148
149 if err := l.Disconnect(); err != nil {
150 t.Fatal(err)
151 }
152
153 // should fail because Disconnect was already called
154 _, err := l.DomainLookupByName(testDomainName)
155 if err == nil {
156 t.Fatal("using a disconnected libvirt should fail")
157 }
158}
159
160func TestLostConnection(t *testing.T) {
161 // In order to be able to close the connection external to libvirt,

Callers

nothing calls this directly

Calls 5

NewWithDialerFunction · 0.85
testDialerFunction · 0.85
DomainLookupByNameMethod · 0.80
ConnectMethod · 0.45
DisconnectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…