-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from CybercentreCanada/stage
Merge stage to main
- Loading branch information
Showing
21 changed files
with
1,425 additions
and
224 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 |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
java-version: '11' | ||
distribution: 'temurin' | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 7.0.2 | ||
- run: gradle test | ||
|
@@ -42,39 +42,41 @@ jobs: | |
java-version: '11' | ||
distribution: 'temurin' | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 7.0.2 | ||
- run: gradle shadowJar | ||
- uses: browser-actions/setup-chrome@v1.4.0 | ||
- run: gradle distZip | ||
- uses: browser-actions/setup-chrome@v1 | ||
with: | ||
chrome-version: 120 | ||
chrome-version: 126 | ||
- uses: nanasess/setup-chromedriver@v2 | ||
with: | ||
chromedriver-version: '120.0.6099.109' | ||
chromedriver-version: '126.0.6478.63' | ||
- name: Get all files ready to run Kangooroo | ||
run: cp /usr/local/bin/chromedriver . && mkdir output && mkdir tmp && cp build/libs/KangoorooStandalone.jar . | ||
run: cp /usr/local/bin/chromedriver . && mkdir output && mkdir tmp && cp build/distributions/kangooroo-*.zip . | ||
|
||
- name: Install Kangooroo Java | ||
run: unzip -j kangooroo-*.zip kangooroo*/lib/* -d lib && unzip -j kangooroo-*.zip kangooroo*/bin/* -d bin | ||
|
||
- name: Run Kangooroo with default settings | ||
run: java -jar KangoorooStandalone.jar --url https://duckduckgo.com/ | ||
run: ./bin/kangooroo -mods summary --url https://duckduckgo.com/ | ||
|
||
- name: Check all output files of Kangooroo is present | ||
run: | | ||
ls --format=commas output/168ce875a2188cce97924a11f6a918df/ > output1.txt | ||
cmp --silent test/integration_test/assert_output_files.txt output1.txt && echo "All expected output files are present." || exit 1 | ||
- name: Check if tmp folder is empty | ||
run: ls -l tmp | grep -q "total 0" || exit 1 | ||
|
||
- name: Check if result.json have expected keys | ||
run: | | ||
grep -qe "response_code" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "connection_success" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requested_url" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requested_url_ip" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actual_url" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actual_url_ip" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requestedUrl" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actualUrl" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "has_timed_out" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "processing_time" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "creationDate" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "processTime" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "startTime" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineName" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineVersion" output/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
|
@@ -98,24 +100,94 @@ jobs: | |
distribution: 'temurin' | ||
|
||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@v3 | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 7.0.2 | ||
- run: gradle shadowJar | ||
- run: gradle distZip | ||
|
||
- uses: browser-actions/setup-chrome@v1.4.0 | ||
- uses: browser-actions/setup-chrome@v1 | ||
with: | ||
chrome-version: 120 | ||
chrome-version: 126 | ||
|
||
- uses: nanasess/setup-chromedriver@v2 | ||
with: | ||
chromedriver-version: '120.0.6099.109' | ||
chromedriver-version: '126.0.6478.63' | ||
|
||
- name: Get all files ready to run Kangooroo | ||
run: cp /usr/local/bin/chromedriver . && mkdir output2 && mkdir tmp && cp build/libs/KangoorooStandalone.jar . | ||
run: cp /usr/local/bin/chromedriver . && mkdir output2 && mkdir tmp && cp build/distributions/kangooroo-*.zip . | ||
|
||
- name: Install Kangooroo Java | ||
run: unzip -j kangooroo-*.zip kangooroo*/lib/* -d lib && unzip -j kangooroo-*.zip kangooroo*/bin/* -d bin | ||
|
||
- name: Run Kangooroo with Proxy | ||
run: java -jar KangoorooStandalone.jar -cf test/integration_test/test_conf.yml --url https://duckduckgo.com/ | ||
run: ./bin/kangooroo -cf test/integration_test/test_conf.yml -mods summary --url https://duckduckgo.com/ | ||
|
||
- name: Check all output files of Kangooroo is present | ||
run: | | ||
ls --format=commas output2/168ce875a2188cce97924a11f6a918df/ > output2.txt | ||
cmp --silent test/integration_test/assert_output_files.txt output2.txt && echo "All expected output files are present." || exit 1 | ||
- name: Check if kangooroo connected to the proxy | ||
run: | | ||
sleep 10 | ||
docker logs "${{ job.services.proxypy.id }}" >& output3.txt | ||
grep -qe "duckduckgo.com:443" output3.txt | ||
- name: Check if tmp folder is empty | ||
run: ls -l tmp | grep -q "total 0" || exit 1 | ||
- name: Check if result.json have expected keys | ||
run: | | ||
grep -qe "response_code" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "connection_success" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requestedUrl" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actualUrl" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "has_timed_out" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "processTime" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "startTime" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineName" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineVersion" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
|
||
with-proxy-sandbox-integration-test: | ||
name: Integration Test Kangooroo with Proxy | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
proxypy: | ||
image: abhinavsingh/proxy.py | ||
ports: | ||
- 8899:8899 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up JDK 11 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Build with Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 7.0.2 | ||
- run: gradle distZip | ||
|
||
- uses: browser-actions/setup-chrome@v1 | ||
with: | ||
chrome-version: 126 | ||
|
||
- uses: nanasess/setup-chromedriver@v2 | ||
with: | ||
chromedriver-version: '126.0.6478.63' | ||
|
||
- name: Get all files ready to run Kangooroo | ||
run: cp /usr/local/bin/chromedriver . && mkdir output2 && mkdir tmp && cp build/distributions/kangooroo-*.zip . | ||
|
||
- name: Install Kangooroo Java | ||
run: unzip -j kangooroo-*.zip kangooroo*/lib/* -d lib && unzip -j kangooroo-*.zip kangooroo*/bin/* -d bin | ||
|
||
- name: Run Kangooroo with Proxy and Sandbox | ||
run: ./bin/kangooroo -mods summary --no-sandbox -cf test/integration_test/test_conf.yml --url https://duckduckgo.com/ | ||
|
||
- name: Check all output files of Kangooroo is present | ||
run: | | ||
|
@@ -130,15 +202,14 @@ jobs: | |
- name: Check if tmp folder is empty | ||
run: ls -l tmp | grep -q "total 0" || exit 1 | ||
- run: cat output2/168ce875a2188cce97924a11f6a918df/results.json | ||
- name: Check if result.json have expected keys | ||
run: | | ||
grep -qe "response_code" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "connection_success" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requested_url" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actual_url" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "requestedUrl" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "actualUrl" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "has_timed_out" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "processing_time" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "creationDate" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "processTime" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "startTime" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineName" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 | ||
grep -qe "engineVersion" output2/168ce875a2188cce97924a11f6a918df/results.json || exit 1 |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.gradle/ | ||
/build/ | ||
.idea/ | ||
gradle/wrapper/gradle-wrapper.properties | ||
.vscode/ |
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
Empty file.
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
Oops, something went wrong.