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
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ test-upgrade: $(JUNITREPORT)
IMAGE_LOGGING_EVENTROUTER=$(IMAGE_LOGGING_EVENTROUTER) \
exit 0

.PHONY: test-e2e-from-ci-bundle
test-e2e-from-ci-bundle: $(JUNITREPORT)
RELATED_IMAGE_VECTOR=$(IMAGE_LOGGING_VECTOR) \
RELATED_IMAGE_LOG_FILE_METRIC_EXPORTER=$(IMAGE_LOGFILEMETRICEXPORTER) \
IMAGE_LOGGING_EVENTROUTER=$(IMAGE_LOGGING_EVENTROUTER) \
IMAGE_TLS_SCANNER=$(IMAGE_TLS_SCANNER) \
LOG_LEVEL=3 hack/test-e2e-from-ci-bundle.sh
Comment thread
qodo-for-rh-openshift[bot] marked this conversation as resolved.

.PHONY: test-e2e
test-e2e: $(JUNITREPORT)
RELATED_IMAGE_VECTOR=$(IMAGE_LOGGING_VECTOR) \
Expand Down
19 changes: 19 additions & 0 deletions hack/test-e2e-from-ci-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
Comment thread
vparfonov marked this conversation as resolved.

set -euo pipefail

repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo_dir"

CLUSTER_LOGGING_OPERATOR_NAMESPACE=${CLUSTER_LOGGING_OPERATOR_NAMESPACE:-openshift-logging}

oc label ns/"${CLUSTER_LOGGING_OPERATOR_NAMESPACE}" openshift.io/cluster-monitoring=true --overwrite
oc label ns/"${CLUSTER_LOGGING_OPERATOR_NAMESPACE}" pod-security.kubernetes.io/enforce=privileged --overwrite
oc label ns/"${CLUSTER_LOGGING_OPERATOR_NAMESPACE}" pod-security.kubernetes.io/audit=privileged --overwrite
oc label ns/"${CLUSTER_LOGGING_OPERATOR_NAMESPACE}" pod-security.kubernetes.io/warn=privileged --overwrite
Comment thread
vparfonov marked this conversation as resolved.

GOFLAGS=-mod=mod go test -p 1 -v -timeout=90m ./test/e2e/... \
-ginkgo.v -ginkgo.trace -ginkgo.no-color \
-ginkgo.skip="FlowControl" \
-ginkgo.poll-progress-after=300s \
-ginkgo.poll-progress-interval=30s
5 changes: 5 additions & 0 deletions test/e2e/collection/security/container_security_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"runtime"
"strings"
"time"

internalruntime "github.com/openshift/cluster-logging-operator/internal/runtime"
Expand Down Expand Up @@ -36,6 +37,10 @@ var _ = Describe("Tests of collector container security stance", func() {
checkMountReadOnly = func(mount string) {
touchFile := mount + "/1"
result, err := runInCollectorContainer("touch", touchFile)
if err != nil && strings.Contains(result, "No such file or directory") {
log.V(0).Info("Mount path does not exist on this node, skipping read-only check", "mount", mount)
return
}
Expect(result).To(MatchRegexp("touch:.cannot.*touch.*" + touchFile + ".*Read-only file system"))
Expect(err).To(MatchError(ContainSubstring("exit status 1")))
}
Expand Down
Loading