Skip to content

Commit

Permalink
tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-sidelnikov committed Jan 9, 2025
1 parent 619fde3 commit b3a6c8b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
1 change: 1 addition & 0 deletions acceptance/openstack/apigw/v2/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func CreateChannel(client *golangsdk.ServiceClient, t *testing.T, id string) *ch
tools.RandomString("hss_group-member-", 3),
"Standard_Debian_10_latest",
"s2.large.2",
"",
)
th.AssertNoErr(t, err)

Expand Down
36 changes: 9 additions & 27 deletions acceptance/openstack/hss/v5/event_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package v2

import (
"os"
"testing"

golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/acceptance/clients"
"github.com/opentelekomcloud/gophertelekomcloud/acceptance/openstack"
"github.com/opentelekomcloud/gophertelekomcloud/acceptance/tools"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/common/tags"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/compute/v2/servers"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/hss/v5/event"
"github.com/opentelekomcloud/gophertelekomcloud/openstack/hss/v5/host"
Expand All @@ -25,9 +25,9 @@ rm -f hostguard_setup_config.conf
rm -f hostguard.x86_64.deb`

func TestEventsLifecycle(t *testing.T) {
// if os.Getenv("RUN_HSS_LIFECYCLE") == "" {
// t.Skip("too slow to run in zuul")
// }
if os.Getenv("RUN_HSS_LIFECYCLE") == "" {
t.Skip("too slow to run in zuul")
}
client, err := clients.NewHssClient()
th.AssertNoErr(t, err)

Expand All @@ -52,8 +52,10 @@ func TestEventsLifecycle(t *testing.T) {
return false, err
}

if len(h) == 1 {
return true, nil
if len(h) > 0 {
if h[0].AgentStatus == "online" {
return true, nil
}
}

return false, nil
Expand Down Expand Up @@ -88,16 +90,6 @@ func TestEventsLifecycle(t *testing.T) {
HostIds: []string{
ecs.ID,
},
Tags: []tags.ResourceTag{
{
Key: "muh",
Value: "kuh",
},
{
Key: "muh2",
Value: "kuh2",
},
},
})
th.AssertNoErr(t, err)

Expand All @@ -108,16 +100,6 @@ func TestEventsLifecycle(t *testing.T) {
HostIds: []string{
ecs.ID,
},
Tags: []tags.ResourceTag{
{
Key: "muh",
Value: "kuh",
},
{
Key: "muh2",
Value: "kuh2",
},
},
})
th.AssertNoErr(t, err)

Expand All @@ -134,7 +116,7 @@ func TestEventsLifecycle(t *testing.T) {
th.AssertNoErr(t, err)
tools.PrintResource(t, listEventsResp)

t.Logf("Attempting to get host events")
t.Logf("Attempting to get alarm whitelist")
listWhitelistsResp, err := event.ListAlarmWhitelist(client, event.ListAlarmWhitelistOpts{})
th.AssertNoErr(t, err)
tools.PrintResource(t, listWhitelistsResp)
Expand Down
8 changes: 5 additions & 3 deletions acceptance/openstack/hss/v5/server_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestServerLifecycle(t *testing.T) {
tools.RandomString("hss-group-member-", 3),
"Standard_Debian_11_latest",
"s2.large.2",
"",
userDataHssAgent,
)
th.AssertNoErr(t, err)

Expand All @@ -62,8 +62,10 @@ func TestServerLifecycle(t *testing.T) {
return false, err
}

if len(h) == 1 {
return true, nil
if len(h) > 0 {
if h[0].AgentStatus == "online" {
return true, nil
}
}

return false, nil
Expand Down

0 comments on commit b3a6c8b

Please sign in to comment.