summaryrefslogtreecommitdiff
path: root/dev-run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dev-run.sh')
-rwxr-xr-xdev-run.sh70
1 files changed, 62 insertions, 8 deletions
diff --git a/dev-run.sh b/dev-run.sh
index 559e602..4d0aa2b 100755
--- a/dev-run.sh
+++ b/dev-run.sh
@@ -1,20 +1,74 @@
#!/bin/bash
-
echo "Checking package"
-mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/dev/null src/collector/*.py # || exit 1
+mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/tmp/ src/collector/*.py # || exit 1
black --line-length 120 src/collector/*.py # || exit 1
pylint --max-line-length 120 src/collector/*.py # || exit 1
+sudo chown -R $USER data/mongodb_data
+docker-compose -f docker-compose.yml build
+
+sudo chown -R 101 data/mongodb_data
+docker-compose -f docker-compose.yml up -d
+
+sleep 2
+
+
+echo
+echo
+curl --data-binary @data/example_data_3.json http://localhost:8000/sc/v0
+echo
+echo
+
+curl -X DELETE http://localhost:8000/sc/v0/63702570e004d2b0b2254d27
+echo
+echo
+curl -X DELETE http://localhost:8000/sc/v0/63702570e004d2b0b2254d27
+echo
+echo
+
+curl -d '{"search": {"port": {"$lt": 4}}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"port": 112}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"port": {"$gt": 4}}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"port": 111}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"port": {"sdfsf": 7}}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"port": {"$sdfsf": 7}}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+curl -d '{"search": {"portfdv": {"$asa": 7}}}' -H 'Content-Type: application/json' http://localhost:8000/sc/v0/search
+echo
+echo
+
+echo
+echo
+curl -X PUT --data-binary @data/example_data_3_replace_test.json http://localhost:8000/sc/v0
+
+
+# bash quickstart.sh -b || exit 1
+# sleep 3
+# JWT=$(curl -k http://localhost:8000/api/v1.0/auth -X POST -p -u usr:pwd | jq -r .access_token) || exit 1
+# curl -k --data-binary @example_data_1.json -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/add || exit 1
+# curl -k --data-binary @example_data_3.json -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/add || exit 1
+# sleep 1
+# curl -k -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/get | json_pp -json_opt utf8,pretty || exit 1
+
+# curl -k -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/get?port=111 || exit 1
-bash quickstart.sh -b || exit 1
-sleep 3
-JWT=$(curl -k http://localhost:8000/api/v1.0/auth -X POST -p -u usr:pwd | jq -r .access_token) || exit 1
-curl -k --data-binary @example_data_1.json -H "Authorization: Bearer $JWT" https://localhost:1443/sc/v0/add || exit 1
-exit 0
+# echo "OK"
+# exit 0
-echo "Checking tests"
+#echo "Checking tests"
#mypy --strict --namespace-packages --ignore-missing-imports --cache-dir=/dev/null tests/*.py || exit 1
#black --line-length 120 tests/*.py || exit 1
#pylint --max-line-length 120 tests/*.py || exit 1