Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions web/cypress/e2e/table/fields.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ describe('netflow-table', () => {
// others
cy.checkRecordField('K8S_FlowLayer', 'Flow layer', ['infra']);

cy.get('[data-test-id="group-5"]').contains("Protocol Info");
cy.get('[data-test-id="group-5"]').contains("L3 Layer");
cy.checkRecordField('Proto', 'Protocol', ['ICMP']);
cy.checkRecordField('Dscp', 'DSCP', ['Standard']);

cy.get('[data-test-id="group-6"]').contains("ICMP");
cy.checkRecordField('IcmpType', 'Type', ['ICMP_DEST_UNREACH']);
cy.checkRecordField('IcmpCode', 'Code', ['ICMP_NET_UNREACH']);

Expand Down Expand Up @@ -119,7 +121,7 @@ describe('netflow-table', () => {
cy.get('#netflow-table-row-2').click();

// check for rtt
cy.checkRecordField('TimeFlowRttMs', 'Flow RTT', ['4ms']);
cy.checkRecordField('TimeFlowRttMs', 'Flow RTT', ['4.05ms']);
});

it('display multiCluster', () => {
Expand Down
97 changes: 0 additions & 97 deletions web/cypress/fixtures/gateway-api-template.yaml

This file was deleted.

121 changes: 121 additions & 0 deletions web/cypress/fixtures/gateway-api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: netobserv-gateway-test
labels:
app: gwapi
---
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: openshift-default
spec:
controllerName: openshift.io/gateway-controller/v1
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: test-gateway-owner
namespace: netobserv-gateway-test
spec:
gatewayClassName: openshift-default
listeners:
- name: demo
hostname: gwapi.example.com
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
app: gwapi
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: test-httproute
namespace: netobserv-gateway-test
labels:
app: gwapi
spec:
parentRefs:
- name: test-gateway-owner
namespace: netobserv-gateway-test
hostnames: ["gwapi.example.com"]
rules:
- backendRefs:
- name: echo-service
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: echo-service
namespace: netobserv-gateway-test
labels:
app: gwapi
spec:
selector:
app: echo-server
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echo-server
namespace: netobserv-gateway-test
labels:
app: gwapi
spec:
replicas: 1
selector:
matchLabels:
app: echo-server
template:
metadata:
labels:
app: echo-server
spec:
containers:
- name: echo
image: hashicorp/http-echo:latest
args:
- -text=echo response
- -listen=:8080
ports:
- containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: traffic-generator
namespace: netobserv-gateway-test
labels:
app: gwapi
component: traffic-generator
spec:
replicas: 1
selector:
matchLabels:
app: traffic-generator
template:
metadata:
labels:
app: traffic-generator
spec:
containers:
- name: traffic-gen
image: curlimages/curl:latest
command:
- /bin/sh
- -c
- |
while true; do
curl -s http://test-gateway-owner-openshift-default.netobserv-gateway-test.svc.cluster.local:8080 || true
sleep 5
done
26 changes: 11 additions & 15 deletions web/cypress/integration-tests/client_performance.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { netflowPage, loadTimes, memoryUsage, overviewSelectors } from "@views/netflow-page"
import { netflowPage, loadTimes, memoryUsage, overviewSelectors, getTopologyScopeURL } from "@views/netflow-page"
import { Operator } from "@views/netobserv"

function getTopologyScopeURL(scope: string): string {
return `**/flow/metrics?filters=&limit=50&recordType=flowLog&dedup=true&packetLoss=all&timeRange=300&rateInterval=30s&step=15s&type=bytes&aggregateBy=${scope}`
}

describe("(OCP-67725, memodi) Network_Observability Client Performances", { browser: 'chrome', tags: ['Performance'] }, function () {
before("tests", function () {
cy.adminCLI(`oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
Expand All @@ -17,10 +13,10 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow

beforeEach("test", function () {
cy.clearLocalStorage()
cy.intercept('**/backend/api/flow/metrics*').as('call1')
cy.visit('/netflow-traffic')
// wait for all calls to complete
cy.wait('@call1', { timeout: 60000 })
// wait for page to be fully loaded
cy.get('#overview-container', { timeout: 60000 }).should('exist')
cy.byTestID('no-results-found').should('not.exist')

})

Expand All @@ -37,7 +33,7 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow
cy.get('#overview-flex').contains(overviewSelectors.defaultPanels[0]).should('be.visible').then(() => {
cy.wrap(performance.now()).then(end => {
let pageload = Math.round(end - start)
let curMemoryUsage = Math.round(window.performance.memory.usedJSHeapSize / 1048576)
let curMemoryUsage = Math.round((window.performance as any).memory?.usedJSHeapSize / 1048576)
cy.log(`Overview page load took ${pageload} ms.`)
cy.log(`Overview page memory consumption ${curMemoryUsage} MB`)
let thresPageload = loadTimes.overview + loadTimes.overview * 0.5
Expand All @@ -49,17 +45,17 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow
})

it("(OCP-67725, memodi, Network_Observability) should measure table page load times", function () {
cy.get('#tabs-container li:nth-child(2)').click()
cy.get('#tabs-container').contains('Traffic flows').click()
netflowPage.clearAllFilters()
const start = performance.now()
const url = '**/backend/api/flow/metrics*'
const url = '**/api/flow/metrics*'
cy.intercept('GET', url, {
fixture: 'perf/netflow_table_perf.json'
})
cy.byTestID("table-composable").should('be.visible').then(() => {
cy.wrap(performance.now()).then(end => {
let pageload = Math.round(end - start)
let curMemoryUsage = Math.round(window.performance.memory.usedJSHeapSize / 1048576)
let curMemoryUsage = Math.round((window.performance as any).memory?.usedJSHeapSize / 1048576)
cy.log(`Table view page load took ${pageload} ms.`)
cy.log(`Table view memory consumption ${curMemoryUsage} MB`)
let thresPageload = loadTimes.table + loadTimes.table * 0.5
Expand All @@ -71,7 +67,7 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow
})

it("(OCP-67725, memodi, Network_Observability) should measure topology page load times", function () {
cy.get('#tabs-container li:nth-child(3)').click()
cy.get('#tabs-container').contains('Topology').click()
netflowPage.clearAllFilters()
const start = performance.now()
cy.intercept('GET', getTopologyScopeURL("namespace"), {
Expand All @@ -80,7 +76,7 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow
cy.get('[data-surface="true"]').should('be.visible').then(() => {
cy.wrap(performance.now()).then(end => {
let pageload = Math.round(end - start)
let curMemoryUsage = Math.round(window.performance.memory.usedJSHeapSize / 1048576)
let curMemoryUsage = Math.round((window.performance as any).memory?.usedJSHeapSize / 1048576)
cy.log(`Topology view page load took ${pageload} ms.`)
cy.log(`Topology view memory consumption ${curMemoryUsage} MB`)
let thresPageload = loadTimes.topology + loadTimes.topology * 0.5
Expand All @@ -94,7 +90,7 @@ describe("(OCP-67725, memodi) Network_Observability Client Performances", { brow
netflowPage.resetClearFilters()
})

after("suite", function () {
after("all tests", function () {
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
})
6 changes: 3 additions & 3 deletions web/cypress/integration-tests/dns_dashboards.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network

it("(OCP-67087, aramesha, Network_Observability) Validate DNSLatencies edge label and Query Summary stats", function () {
netflowPage.visit()
cy.get('#tabs-container li:nth-child(3)').click()
cy.get('#tabs-container').contains('Topology').click()
cy.get('#drawer').should('not.be.empty')
cy.get(filterSelectors.filterInput).type("dns_latency>=0" + '{enter}')

Expand All @@ -56,7 +56,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network
cy.byTestID("scope-dropdown").click().get("#host").click()
cy.contains('Display options').should('exist').click()

cy.get('[data-test-id=edge-handler]').should('exist').each((g) => {
cy.byLegacyTestID('edge-handler').should('exist').each((g) => {
expect(g.text()).to.match(/\d+\s*ms/);
});

Expand All @@ -75,7 +75,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network
cy.checkDashboards(DNSPanels)
})

after("Delete flowcollector and DNS pods", function () {
after("all tests", function () {
Operator.deleteFlowCollector()
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
Expand Down
4 changes: 2 additions & 2 deletions web/cypress/integration-tests/dns_tracking.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network
})

it("(OCP-67087, aramesha) Validate DNSTracking columns and DNSName", function () {
cy.get('#tabs-container li:nth-child(2)').click()
cy.get('#tabs-container').contains('Traffic flows').click()
cy.byTestID("table-composable").should('exist')
netflowPage.stopAutoRefresh()

Expand Down Expand Up @@ -91,7 +91,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network
netflowPage.resetClearFilters()
})

after("Delete flowcollector and DNS pods", function () {
after("all tests", function () {
Operator.deleteFlowCollector()
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
Expand Down
Loading
Loading