-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[metrics 3/x] end-to-end tests #702
base: master
Are you sure you want to change the base?
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
4ae399a
to
87f725c
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
Pull Request Test Coverage Report for Build 9207813927Details
💛 - Coveralls |
87f725c
to
2e4cab8
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
2e4cab8
to
f824a33
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
f824a33
to
f11ade3
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
f11ade3
to
20d2790
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
20d2790
to
af25c1b
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
af25c1b
to
9e21801
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
9e21801
to
35b5ded
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
var _ = Describe("[sriov] Metrics Exporter", Ordered, func() { | ||
|
||
BeforeAll(func() { | ||
if cluster.VirtualCluster() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one needs to be in the beforeEach no? if we have multiple tests only the first one will get skipped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with ginkgo v2:
In ginkgo v1 there was no BeforeAll, and we invented our own version of it
sriov-network-operator/test/util/execute/ginkgo.go
Lines 7 to 15 in 6b9f1c2
func BeforeAll(fn func()) { | |
first := true | |
ginkgo.BeforeEach(func() { | |
if first { | |
first = false | |
fn() | |
} | |
}) | |
} |
which has the "test skip" problem.
Ginkgo v2 BeforeAll
can handle test skips, though it can be used in Ordered
containers only.
|
||
metricsExporterPod := metricsExporterPods.Items[0] | ||
|
||
command := []string{"wget", "-qO-", "http://127.0.0.1:9110/metrics"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please switch this one to curl as in the ubi images we don't have wget
Trying to pull registry.redhat.io/ubi9/ubi:latest...
Getting image source signatures
Checking if image destination supports signatures
Copying blob bb65efb0bec6 done
Copying config 02eedf8dcc done
Writing manifest to image destination
Storing signatures
[root@d7d4fbbaf778 /]# wget
bash: wget: command not found
[root@d7d4fbbaf778 /]# curl
curl: try 'curl --help' for more information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! no problem!
finalRxPackets := getCounterForPod(finalMetrics, pod, "sriov_vf_rx_packets") | ||
|
||
Expect(finalRxBytes).Should(BeNumerically(">", initialRxBytes)) | ||
Expect(finalRxPackets).Should(BeNumerically(">", initialRxPackets+3)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you add the +3 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because pingPod(...)
function sends 3 ICMP packets
sriov-network-operator/test/conformance/tests/test_sriov_operator.go
Lines 2652 to 2669 in a8476f0
func pingPod(ip string, nodeSelector string, sriovNetworkAttachment string) { | |
ipProtocolVersion := "6" | |
if len(strings.Split(ip, ".")) == 4 { | |
ipProtocolVersion = "4" | |
} | |
podDefinition := pod.RedefineWithNodeSelector( | |
pod.RedefineWithCapabilities( | |
pod.RedefineWithRestartPolicy( | |
pod.RedefineWithCommand( | |
pod.DefineWithNetworks([]string{sriovNetworkAttachment}), | |
[]string{"sh", "-c", fmt.Sprintf("ping -%s -c 3 %s", ipProtocolVersion, ip)}, []string{}, | |
), | |
corev1.RestartPolicyNever, | |
), | |
[]corev1.Capability{"NET_RAW"}, | |
), | |
nodeSelector, | |
) |
I could refactor that function a bit to make this information more explicit
Package `github.com/prometheus-operator/prometheus-operator/pkg/client` can be used for testing purpose. Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
Deploy the needed configuration to make the prometheus operator to find and scrape the sriov-network-metrics-exporter endpoints, including the ServiceMonitor, Role and RoleBinding. Resources are installed only if the Prometheus operator is installed. Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
35b5ded
to
a8476f0
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
Exposed metrics can be verified by scraping the prometheus endpoint on the `sriov-network-metrics-exporter` pod. Add a test that spawns an SR-IOV consuming pod and verifies its receiving counter increase when the interface is pinged from outside. Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
a8476f0
to
ae75722
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
Exposed metrics can be verified by scraping the prometheus
endpoint on the
sriov-network-metrics-exporter
pod.Add a test that spawns an SR-IOV consuming pod and verifies
its receiving counter increase when the interface is pinged from
outside.
depends on: