Skip to content

Commit

Permalink
Test that nodes cluster correctly
Browse files Browse the repository at this point in the history
By querying the /nodes endpoint of the management API, we test that
nodes cluster correctly.

This test fails if we hit the issue described in #662.
  • Loading branch information
ansd committed May 26, 2021
1 parent cd8fd0a commit 371f231
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion system_tests/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strconv"
Expand All @@ -22,10 +23,10 @@ import (
k8sresource "k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/types"

rabbithole "github.com/michaelklishin/rabbit-hole/v2"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gstruct"

rabbitmqv1beta1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
Expand Down Expand Up @@ -380,6 +381,14 @@ CONSOLE_LOG=new`
response, err := alivenessTest(hostname, port, username, password)
Expect(err).NotTo(HaveOccurred())
Expect(response.Status).To(Equal("ok"))

// test https://github.com/rabbitmq/cluster-operator/issues/662 is fixed
By("clustering correctly")
rmqc, err := rabbithole.NewClient(fmt.Sprintf("http://%s:%s", hostname, port), username, password)
Expect(err).NotTo(HaveOccurred())
nodes, err := rmqc.ListNodes()
Expect(err).NotTo(HaveOccurred())
Expect(nodes).To(HaveLen(3))
})
})
})
Expand Down

0 comments on commit 371f231

Please sign in to comment.