File tree Expand file tree Collapse file tree 5 files changed +19
-13
lines changed Expand file tree Collapse file tree 5 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ install:
77 - sudo apt-get install linux-headers-$(uname -r) dkms gcc-multilib g++-multilib
88 - pip install pyyaml requests
99script :
10+ - bash test/start_agent.sh
1011- bash test/test_monitor_apis.sh
1112- bash test/test_secure_apis.sh
13+ - bash test/stop_agent.sh
1214notifications :
1315 slack :
1416 secure : GJ0H2wAaW67t3+x+cCjOVLw/b+YAZjH9rebAfluCFJklJS9u+V6/qqIyiNDAkMPIcgilFyhiyOQCZYXapgthQ1ieFbZZo//mrRtuGo2wuxCAwcOx2mXAZpZ4I5b3+Q/znVqSuqkwFRid1d138z4TW7sYSIburouDX3QUNoUOy+g7VJxCFQCcqlN8LYxGJHQYdOZa9zIGCtKrOtZ/B8C1TLgXmDMwAAVNO2WzL4GiBTLCGuMsQWMTLw2Qmv1ayZPztmeDWo1C9oa7HIH8Bg2YVjssR87el28X+EqEO533mgYjPmW2/hii30WVFOUE5hMdvKeQLBvy5N3/OCch1np0RQBd8eYEtaPv38rc5L2wAnUq9G5Zzr252z7vnwSLi6lap9jWU8tOerSTEPU+jG05PnuCnufVDXVNPyiPsH6BDP4qxHmLjooNpxfe63Df7NNyUi2I3QoroLj/UzI7zZVQjJEqsTrr5BbsH4z6NTGY91+ZqobBn62+hV3ESAam0ivQgC7s2AKko0qkKyIUGjj7ozU8ebo1UpagNvKC/J9szMqtdXJgKtG8BeonyLMeN6MEEyEvcMJbB4dCcfet+1Sb9AZWnGvYVdajhVLb1HE6OrbzZyhC3KqCe06J9O5BCY9ncy+l16i7MyIfcKTibHQlxPU+Id/VijD97JSRXxnd2i4=
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euxo pipefail
4+
5+ # Start an agent using the testing account API key to send some data
6+ docker run -d -it --rm --name sysdig-agent --privileged --net host --pid host -e COLLECTOR=collector-staging.sysdigcloud.com -e ACCESS_KEY=$PYTHON_SDC_TEST_ACCESS_KEY -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro --shm-size=350m sysdig/agent
7+
8+ # make sure the agent starts sending data and the backend makes it available via API
9+ sleep 60
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euxo pipefail
4+
5+ docker logs sysdig-agent
6+ docker stop sysdig-agent
Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ SCRIPTDIR=$(dirname $SCRIPT)
77
88export SDC_URL=https://app-staging.sysdigcloud.com
99
10- docker run -d -it --rm --name sysdig-agent --privileged --net host --pid host -e COLLECTOR=collector-staging.sysdigcloud.com -e ACCESS_KEY=$PYTHON_SDC_TEST_ACCESS_KEY -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro sysdig/agent
11-
12- sleep 20
13-
1410AGENT_HOSTNAME=$( hostname -s)
1511SESSION_UUID=$( head -c 32 /dev/urandom | tr -dc ' a-zA-Z0-9' )
1612ALERT_NAME=python-test-alert-$SESSION_UUID
@@ -49,6 +45,3 @@ date; $SCRIPTDIR/../examples/create_sysdig_capture.py $PYTHON_SDC_TEST_MONITOR_A
4945date; $SCRIPTDIR /../examples/notification_channels.py -c $CHANNEL_NAME $PYTHON_SDC_TEST_MONITOR_API_TOKEN
5046date; $SCRIPTDIR /../examples/user_team_mgmt.py $PYTHON_SDC_TEST_MONITOR_API_TOKEN $TEAM_NAME example-user@example-domain.com
5147date; $SCRIPTDIR /../examples/user_team_mgmt_extended.py $PYTHON_SDC_TEST_MONITOR_API_TOKEN $TEAM_NAME example-user@example-domain.com
52-
53- docker stop sysdig-agent
54-
Original file line number Diff line number Diff line change 131131
132132echo $OUT
133133
134- # Start an agent using this account's api key and trigger some events
135- docker run -d -it --rm --name sysdig-agent --privileged --net host --pid host -e COLLECTOR=collector-staging.sysdigcloud.com -e ACCESS_KEY=$PYTHON_SDC_TEST_ACCESS_KEY -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro -e ADDITIONAL_CONF=" security: {enabled: true}\ncommandlines_capture: {enabled: true}\nmemdump: {enabled: true}" --shm-size=350m sysdig/agent
136-
134+ # Trigger some events
137135FOUND=0
138136
139137for i in $( seq 10) ; do
140- sleep 10
141138 sudo touch /bin/some-file.txt
139+ sleep 10
142140
143141 EVTS=` $SCRIPTDIR /../examples/get_secure_policy_events.py $PYTHON_SDC_TEST_API_TOKEN 60`
144142
@@ -147,8 +145,6 @@ for i in $(seq 10); do
147145 break ;
148146 fi
149147done
150- docker logs sysdig-agent
151- docker stop sysdig-agent
152148
153149if [[ $FOUND == 0 ]]; then
154150 echo " Did not find any policy events after 10 attempts..."
You can’t perform that action at this time.
0 commit comments