1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

Fix minor bugs on GOCA tests (#2979)

This commit is contained in:
Christian González 2019-02-22 10:12:28 +01:00 committed by Tino Vázquez
parent ef0422030e
commit f676656485

View File

@ -156,12 +156,13 @@ func TestVirtualRouter(t *testing.T){
vr.Info()
actualNet, err := vr.Template.Dynamic.GetContentByName("NETWORK")
if err != nil {
t.Errorf("Test failed, can't retrieve '%s', error: %s", "NETWORK", err.Error())
if len(vr.Template.NIC) == 0{
t.Errorf("Test failed, can't retrieve '%s', error: %s", "NIC", err.Error())
} else {
if actualNet != "go-net" {
t.Errorf("Test failed, expected: '%s', got: '%s'", "go-net", actualNet)
actualNetName, _ := vr.Template.NIC[0].Dynamic.GetContentByName("NETWORK")
if actualNetName != "go-net" {
t.Errorf("Test failed, expected: '%s', got: '%s'", "go-net", actualNetName)
}
}
@ -202,12 +203,8 @@ func TestVirtualRouter(t *testing.T){
vr.Info()
actualLock = vr.LockInfos
if actualLock == nil {
t.Errorf("Test failed, expected: '%s', got: '%s'", "LockInfos", "nil")
}
// XXX is it useful ? fail at previous part ?
if actualLock.Locked != 0 {
t.Errorf("Test failed, expected: '%d', got: '%d'", 0, actualLock.Locked)
if actualLock != nil {
t.Errorf("Test failed, expected: '%s', got: '%s'", "nil", "LockInfos")
}
//Delete VirtualRouter