-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(integration): add tailing sidecar test
Signed-off-by: Dominik Rosiek <[email protected]>
- Loading branch information
Dominik Rosiek
committed
Jul 12, 2023
1 parent
7e9bc97
commit 067c3f6
Showing
5 changed files
with
156 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build onlylatest | ||
// +build onlylatest | ||
|
||
package integration | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func Test_Helm_Tailing_Sidecar(t *testing.T) { | ||
installChecks := []featureCheck{ | ||
CheckOtelcolMetadataLogsInstall, | ||
CheckTailingSidecarOperatorInstall, | ||
} | ||
|
||
featInstall := GetInstallFeature(installChecks) | ||
|
||
featTailingSidecarTest := GetTailingSidecarFeature() | ||
|
||
testenv.Test(t, featInstall, featTailingSidecarTest) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sumologic: | ||
events: | ||
enabled: false | ||
metrics: | ||
enabled: false | ||
traces: | ||
enabled: false | ||
|
||
tailing-sidecar-operator: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: tailing-sidecar | ||
--- | ||
apiVersion: tailing-sidecar.sumologic.com/v1 | ||
kind: TailingSidecarConfig | ||
metadata: | ||
name: test-tailing-sidecar-operator | ||
namespace: tailing-sidecar | ||
spec: | ||
podSelector: | ||
matchLabels: | ||
test-tailing-sidecar: "true" | ||
configs: | ||
test-sidecar: | ||
volumeMount: | ||
name: varlogconfig | ||
mountPath: /varconfig/log | ||
path: /varconfig/log/example2.log | ||
annotations: | ||
sourceCategory: test-sidecar | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: test-tailing-sidecar-operator | ||
namespace: tailing-sidecar | ||
labels: | ||
app: test-tailing-sidecar-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
tailing-sidecar: "true" | ||
test-tailing-sidecar: "true" | ||
app: test-tailing-sidecar-operator | ||
template: | ||
metadata: | ||
name: test-tailing-sidecar-operator | ||
namespace: tailing-sidecar | ||
annotations: | ||
tailing-sidecar: varlog:/var/log/example0.log;named-container:varlog:/var/log/example1.log | ||
labels: | ||
tailing-sidecar: "true" | ||
test-tailing-sidecar: "true" | ||
app: test-tailing-sidecar-operator | ||
spec: | ||
containers: | ||
- name: count | ||
image: bash | ||
args: | ||
- /usr/local/bin/bash | ||
- -c | ||
- > | ||
i=0; for i in {1..50}; do | ||
echo "example0: $i $(date)" >> /var/log/example0.log; | ||
echo "example1: $i $(date)" >> /var/log/example1.log; | ||
echo "example2: $i $(date)" >> /varconfig/log/example2.log; | ||
sleep 1; | ||
done; while true; do | ||
sleep 1; | ||
done; | ||
volumeMounts: | ||
- name: varlog | ||
mountPath: /var/log | ||
- name: varlogconfig | ||
mountPath: /varconfig/log | ||
volumes: | ||
- name: varlog | ||
emptyDir: {} | ||
- name: varlogconfig | ||
emptyDir: {} | ||
securityContext: | ||
runAsUser: 1000 |