Skip to content
Merged
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
21 changes: 21 additions & 0 deletions web/cypress/fixtures/flowcollector/fc_TLSTracking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
kind: FlowCollector
apiVersion: flows.netobserv.io/v1beta2
metadata:
name: cluster
spec:
agent:
ebpf:
sampling: 1
features:
- TLSTracking
type: eBPF
loki:
enable: true
mode: Monolithic
namespace: netobserv
monolithic:
installDemoLoki: true
processor:
metrics:
additionalIncludeList:
- workload_tls_flows_total
153 changes: 73 additions & 80 deletions web/cypress/fixtures/test-server-client.yaml
Original file line number Diff line number Diff line change
@@ -1,94 +1,87 @@
apiVersion: template.openshift.io/v1
kind: Template
---
apiVersion: v1
kind: Namespace
metadata:
name: netobserv-test-client-server
objects:
- kind: Namespace
apiVersion: v1
metadata:
name: ${SERVER_NS}
labels:
name: ${SERVER_NS}
- apiVersion: apps/v1
kind: Deployment
name: test-server-56222
Comment thread
coderabbitai[bot] marked this conversation as resolved.
labels:
name: test-server-56222
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: test-server-56222
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
name: nginx
namespace: ${SERVER_NS}
labels:
app: nginx
spec:
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
privileged: false
image: quay.io/openshifttest/nginx-alpine:1.2.3
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
- apiVersion: v1
kind: Service
metadata:
namespace: ${SERVER_NS}
name: nginx-service
spec:
selector:
app: nginx
type: NodePort
ports:
- protocol: TCP
port: 80
targetPort: 8080
- kind: Namespace
apiVersion: v1
metadata:
name: ${CLIENT_NS}
labels:
name: ${CLIENT_NS}
- apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: client
name: client
namespace: ${CLIENT_NS}
spec:
containers:
- command:
- sh
- -c
- "
\ while : ; do\n
\ curl nginx-service.${SERVER_NS}.svc:80/data/100K 2>&1 > /dev/null ; sleep 5 \n
\ done"
image: quay.io/openshifttest/hello-openshift:1.2.0
- name: nginx
image: quay.io/openshifttest/nginx-alpine:1.2.3
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
privileged: false
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
name: client
parameters:
- name: SERVER_NS
value: test-server
- name: CLIENT_NS
value: test-client
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
namespace: test-server-56222
name: nginx-service
spec:
selector:
app: nginx
type: NodePort
ports:
- protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: v1
kind: Namespace
metadata:
name: test-client-56222
labels:
name: test-client-56222
---
apiVersion: v1
kind: Pod
metadata:
labels:
run: client
name: client
namespace: test-client-56222
spec:
containers:
- name: client
image: quay.io/openshifttest/hello-openshift:1.2.0
command:
- sh
- -c
- |
while : ; do
curl nginx-service.test-server-56222.svc:80/data/100K 2>&1 > /dev/null
sleep 5
done
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
25 changes: 8 additions & 17 deletions web/cypress/integration-tests/dns_tracking.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,14 @@ describe('(OCP-67087) DNSTracking test', { tags: ['Network_Observability'] }, fu
cy.get(filterSelectors.filterInput).type("dst_namespace=" + project + '{enter}')
cy.get(filterSelectors.filterInput).type("dns_name=" + dns_name + '{enter}')

// select DNS Id and DNS Error columns
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#DNSId').check()
cy.get('#DNSErrNo').check()
cy.get('#DNSName').check()
cy.byTestID(colSelectors.save).click()
})

// verify they are visible in table view
cy.byTestID('table-composable').should('exist').within(() => {
cy.get(colSelectors.dnsId).should('exist')
cy.get(colSelectors.dnsError).should('exist')
cy.get(colSelectors.dnsName).should('exist')
})

// Verify DNSName column for all rows
// select DNS Id, DNS Error and DNS Name columns
cy.selectAndVerifyColumns([
colSelectors.dnsId,
colSelectors.dnsError,
colSelectors.dnsName
])

// Verify DNSName value for all rows
cy.get('[data-test-td-column-id="DNSName"]').each((td) => {
expect(td).to.contain(`${dns_name}`)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ describe.skip('(OCP-67617) User in group with cluster-admin role', { tags: ['Net
cy.visit('/netflow-traffic')
// validate user is not able to access netflow traffic page
// overview shows no panels
cy.get('li.overviewTabButton').should('exist').click()
cy.get('#tabs-container').contains('Overview').click()
cy.get("#overview-flex").should('not.exist')

// table view shows no grid
cy.get('li.tableTabButton').should('exist').click()
cy.get('#tabs-container').contains('Traffic flows').click()
cy.byTestID("table-composable").should('not.exist')

// topology view shows no view
cy.get('li.topologyTabButton').should('exist').click()
cy.get('#tabs-container').contains('Topology').click()
cy.byTestID("error-state").should('exist')
})

Expand Down
10 changes: 4 additions & 6 deletions web/cypress/integration-tests/netflow_external_subnet.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ describe('(OCP-67615, OCP-72874) Return external traffic and custom subnet label
cy.byTestID("table-composable").should('exist')

// enable SrcSubnetLabel and DstSubnetLabel columns
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#SrcSubnetLabel').check()
cy.get('#DstSubnetLabel').check()
cy.byTestID(colSelectors.save).click()
})
cy.selectAndVerifyColumns([
colSelectors.srcSubnetLabel,
colSelectors.dstSubnetLabel
])

// filter on SrcSubnetLabel Pods and DstIP 52.200.142.250
cy.get(filterSelectors.filterInput).type("src_subnet_label=Pods" + '{enter}')
Expand Down
24 changes: 10 additions & 14 deletions web/cypress/integration-tests/netflow_table.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408) Netflow Table view tests'
netflowPage.stopAutoRefresh()
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#K8S_OwnerObject').check()
cy.get('#AddrPort').check()
cy.get(colSelectors.k8sOwner).check()
cy.get(colSelectors.ipPort).check()

cy.get('#Mac').should('exist').check()
cy.get('#FlowDirection').should('exist').check()
cy.get(colSelectors.mac).should('exist').check()
cy.get(colSelectors.direction).should('exist').check()
// ICMP related columns
cy.get('#IcmpType').should('exist').check()
cy.get('#IcmpCode').should('exist').check()
cy.get(colSelectors.icmpType).should('exist').check()
cy.get(colSelectors.icmpCode).should('exist').check()

// source columns
cy.get('#SrcK8S_HostIP').check()
cy.get(colSelectors.srcNodeIP).check()
cy.get('#SrcK8S_Namespace[type="checkbox"]').uncheck()

// dest columns
cy.get('#DstK8S_HostIP').check()
cy.get(colSelectors.dstNodeIP).check()

cy.byTestID(colSelectors.save).click()
})
Expand Down Expand Up @@ -170,11 +170,7 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408) Netflow Table view tests'
cy.contains('Display options').should('exist').click()
cy.byTestID('size-s').click()
cy.contains('Display options').should('exist').click()
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#StartTime').check()
cy.byTestID(colSelectors.save).click()
})
cy.selectAndVerifyColumns([colSelectors.startTime])
cy.byTestID("show-view-options-button").should('exist').click()
})

Expand Down Expand Up @@ -267,7 +263,7 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408) Netflow Table view tests'
cy.byTestID("show-histogram-button").should('exist').click().then(() => {
cy.get('#time-range-dropdown-dropdown').should('exist').click()
cy.get("#5m").should("exist").click()
cy.byTestID("refresh-dropdown-dropdown").should('exist').should('not.be.disabled')
cy.byTestID(genSelectors.refreshDrop).should('exist').should('not.be.disabled')
})
})

Expand Down
25 changes: 6 additions & 19 deletions web/cypress/integration-tests/netflow_zone_multiCluster.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,12 @@ describe('Netflow Zone and multiCluster test', { tags: ['Network_Observability']
cy.get('#tabs-container').contains('Traffic flows').click()
cy.byTestID("table-composable").should('exist')

cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
// Check zone columns
cy.get('#SrcZone').check()
cy.get('#DstZone').check()

// Check multiCluster column
cy.get('#ClusterName').check()
cy.byTestID(colSelectors.save).click()
})

cy.byTestID('table-composable').should('exist').within(() => {
// Verify zone column
cy.get(colSelectors.srcZone).should('exist')
cy.get(colSelectors.dstZone).should('exist')

// Verify multiCluster column
cy.get(colSelectors.clusterName).should('exist')
})
// Check zone and multiCluster columns
cy.selectAndVerifyColumns([
colSelectors.srcZone,
colSelectors.dstZone,
colSelectors.clusterName
])
})

it("(OCP-71524, aramesha) should verify zone/cluster scope topology", function () {
Expand Down
16 changes: 11 additions & 5 deletions web/cypress/integration-tests/quickFilters.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@ var patch = [{
}
]
}]
var templateParams = `-p SERVER_NS=${SERVER_NS} CLIENT_NS=${CLIENT_NS}`
var templateProcessCmd = `oc process -f cypress/fixtures/test-server-client.yaml ${templateParams} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`

describe('(OCP-56222) Quick Filters test', { tags: ['Network_Observability'] }, function () {

before('any test', function () {
cy.adminCLI(`oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
cy.uiLogin(Cypress.env('LOGIN_IDP'), Cypress.env('LOGIN_USERNAME'), Cypress.env('LOGIN_PASSWORD'))
// create test server and client pods
cy.adminCLI(`${templateProcessCmd}| oc apply -f -`)

Operator.install()
cy.checkStorageClass(this)
Operator.createFlowcollector()

// create test server and client pods
cy.adminCLI('oc apply -f cypress/fixtures/test-server-client.yaml')

// Wait for pods to be created
cy.wait(10000)

// Wait for pods to be ready
cy.adminCLI('oc wait --for=condition=Ready pod -l app=nginx -n test-server-56222 --timeout=120s')
cy.adminCLI('oc wait --for=condition=Ready pod -n test-client-56222 client --timeout=120s')
})

beforeEach('any netflow table test', function () {
Expand Down Expand Up @@ -88,7 +94,7 @@ describe('(OCP-56222) Quick Filters test', { tags: ['Network_Observability'] },
})

after("all tests", function () {
cy.adminCLI(`${templateProcessCmd} | oc delete -f -`)
cy.adminCLI('oc delete -f cypress/fixtures/test-server-client.yaml --ignore-not-found')
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
})
11 changes: 1 addition & 10 deletions web/cypress/integration-tests/table_queryopts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,7 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408) Netflow Table Query Optio

it("(OCP-68125, aramesha) should verify DSCP column", function () {
netflowPage.stopAutoRefresh()
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#Dscp').check()
cy.byTestID(colSelectors.save).click()
})
cy.reload()

cy.byTestID('table-composable').should('exist').within(() => {
cy.get(colSelectors.dscp).should('exist')
})
cy.selectAndVerifyColumns([colSelectors.dscp])

// filter on DSCP values
cy.get(filterSelectors.filterInput).type("dscp=0" + '{enter}').click()
Expand Down
Loading
Loading