-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d82432c
commit 4bd7f71
Showing
7 changed files
with
241 additions
and
49 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
44 changes: 44 additions & 0 deletions
44
appveyor/e2e_tests/docker_compose_client_collection_test.py
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,44 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import time | ||
|
||
from grr_api_client import api | ||
|
||
|
||
grrapi = api.InitHttp(api_endpoint="http://localhost:8000", | ||
auth=("admin", "root")) | ||
|
||
search_result = grrapi.SearchClients() | ||
|
||
result = {} | ||
for client in search_result: | ||
client_id = client.client_id | ||
client_last_seen_at = client.data.last_seen_at | ||
result[client_id] = client_last_seen_at | ||
|
||
assert len(result) == 1 | ||
|
||
|
||
flow_args = grrapi.types.CreateFlowArgs("FileFinder") | ||
flow_args.ClearField("paths") | ||
flow_args.paths.append("/client_templates/*") | ||
flow_args.action.action_type = flow_args.action.DOWNLOAD | ||
|
||
hunt_runner_args = grrapi.types.CreateHuntRunnerArgs() | ||
|
||
hunt = grrapi.CreateHunt(flow_name="FileFinder", flow_args=flow_args, | ||
hunt_runner_args=hunt_runner_args) | ||
hunt = hunt.Start() | ||
|
||
# Wait until results are available. | ||
time.sleep(20) | ||
|
||
found_files = set([f.payload.stat_entry.pathspec.path for f in hunt.ListResults()]) | ||
|
||
assert len(found_files) == 4 | ||
assert found_files == { | ||
'/client_templates/windows-installers', | ||
'/client_templates/osx-installers', | ||
'/client_templates/centos-installers', | ||
'/client_templates/ubuntu-installers' | ||
} |
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,51 @@ | ||
#!/bin/bash | ||
# | ||
# Runs the e2e test in the docker-compose stack. | ||
|
||
set -ex | ||
|
||
readonly GRR_ADMIN_PASS="root" | ||
|
||
readonly CLIENT_IP=${1} | ||
|
||
readonly FLAKY_TESTS_ARR=(\ | ||
TestCheckRunner.runTest \ | ||
) | ||
# Convert array to string (comma-separated). | ||
readonly FLAKY_TESTS="$(IFS=,;echo "${FLAKY_TESTS_ARR[*]}")" | ||
|
||
function fatal() { | ||
>&2 echo "Error: ${1}" | ||
exit 1 | ||
} | ||
|
||
# Install the grr tests | ||
cd /usr/src/grr && pip install -e grr/test && cd - | ||
|
||
# grr_config_updater add_user ${GRR_ADMIN_USER} \ | ||
# --password ${GRR_ADMIN_PASS} \ | ||
# --secondary_configs docker_config_files/server/grr.server.yaml | ||
|
||
grr_end_to_end_tests --verbose \ | ||
--secondary_configs docker_config_files/testing/grr.testing.yaml \ | ||
--api_endpoint "http://host.docker.internal:8000" \ | ||
--api_user "${GRR_ADMIN_USER}" \ | ||
--api_password "${GRR_ADMIN_PASS}" \ | ||
--client_ip "${CLIENT_IP}" \ | ||
--noupload_test_binaries \ | ||
--flow_timeout_secs 240 \ | ||
--flow_results_sla_secs 60 \ | ||
--skip_tests "${FLAKY_TESTS}" \ | ||
2>&1 | tee e2e.log | ||
|
||
if [[ ! -z "$(cat e2e.log | grep -F '[ FAIL ]')" ]]; then | ||
fatal 'End-to-end tests failed.' | ||
fi | ||
|
||
if [[ -z "$(cat e2e.log | grep -F '[ PASS ]')" ]]; then | ||
fatal "Expected to find at least one passing test in the test log. It is possible no tests actually ran." | ||
fi | ||
|
||
|
||
|
||
|
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,60 @@ | ||
AdminUI.csrf_secret_key: KPK,_0a_xY&DTeiaokEdsH1uXGobNIhfrr67BTSLlPPv64_UE0nyn8QsD6 | ||
nwNZ-C87mwVLkdrc77AKdoz12hxzmYXsBTT1bC#d7 | ||
AdminUI.url: http://admin-ui:8000 | ||
AdminUI.bind: 0.0.0.0 | ||
AdminUI.use_precompiled_js: true | ||
|
||
Server.initialized: true | ||
Server.fleetspeak_enabled: true | ||
Server.fleetspeak_server: fleetspeak-admin:4444 | ||
Server.fleetspeak_message_listen_address: grr-fleetspeak-frontend:11111 | ||
|
||
API.DefaultRouter: ApiCallRouterWithoutChecks | ||
|
||
Mysql.host: host.docker.internal | ||
Mysql.port: 3306 | ||
Mysql.database_name: fleetspeak | ||
Mysql.database_password: fleetspeak-password | ||
Mysql.database_username: fleetspeak-user | ||
Mysql.database: grr | ||
Mysql.password: grrp | ||
Mysql.username: grru | ||
|
||
Blobstore.implementation: DbBlobStore | ||
Database.implementation: MysqlDB | ||
|
||
Client.fleetspeak_enabled: true # TODO remove? | ||
ClientBuilder.fleetspeak_bundled: true # TODO remove? | ||
|
||
Logging.domain: admin-ui | ||
Monitoring.alert_email: grr-monitoring@admin-ui | ||
Monitoring.emergency_access_email: grr-emergency@admin-ui | ||
|
||
PrivateKeys.executable_signing_private_key: | | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpAIBAAKCAQEAx6YQNUwITzi7l+biDnwvn63Rg3vbfPZexL/0O1XzQw1Z7mFp | ||
3uHtnSrkgDmqYIDXwxDXvn8Ck+k8dYt8SZCcJq4Jd/YkJXaUiM2E/2Y+Gv33ioVa | ||
N7QRyVBGRldK7X6a9Z8tEBE8jF3mlzlO2Z16ZCgMLD1I6ZJpHfQFcDGJP7idHY1T | ||
VHJ7j9YG8PObi2k9r5E9UBg6DcFD3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Uf9i8/KpSKqfOECgYB8Kj23TpQdw0FRTwv3RTV6e6vtpXEsMGQMAnPU | ||
EY5FOSxB0hscfMeniVPRG0pxy2sieDJ4aL7Go6YrFBHcdaQJI3UTgqaQqR7cdHbH | ||
bUNNiixErj7rf95qW2+w0rEB13i+Sm4Bv5gqbGT5D1nWC8ruGDgfYIbzwUwr6ye6 | ||
I4CW+QKBgQC9xKPizqJoi375rDeLVSc/bN3fidyj+Ti87YQa9sDSyXxSF2uk2HUF | ||
xCjMJcqyIOhPSze9wpip6edj8p6N3pvKEMLdFrRJR9Gkv/V9+kJffJbLwyH6Ta/x | ||
v89V954580cna0V/lZYpZM/DDdhVv3hCaGIm+uAHA1mYtxzBBTKX3Q== | ||
-----END RSA PRIVATE KEY----- |
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