Skip to content

Commit 9158590

Browse files
committed
Merge branch 'develop' of https://github.com/WebFuzzing/EMB
2 parents 8fdcad1 + 5714a1b commit 9158590

171 files changed

Lines changed: 228 additions & 194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,17 @@ on:
99

1010
jobs:
1111

12-
# TODO need to use profiles to avoid dependencies to EM in the build... would work on master, but not on develop due to snapshot versions
13-
# docker-build:
14-
# # this one doesn't use EvoMaster drivers
15-
# runs-on: ubuntu-latest
16-
# steps:
17-
# - name: Checkout WFD
18-
# uses: actions/checkout@v6
19-
# - name: Build All With Docker
20-
# run: python scripts/dist-docker.py
12+
docker-build:
13+
# this one doesn't use EvoMaster drivers by default
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout WFD
17+
uses: actions/checkout@v6
18+
- name: Build All With Docker
19+
run: python scripts/dist-docker.py
2120

2221
direct-builds:
23-
# TODO put back once issue fixed
24-
# needs: docker-build
22+
needs: docker-build
2523
runs-on: ${{ matrix.os }}
2624
strategy:
2725
matrix:

experiments/bb-exp.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(self, name, auth, sleep, schemaformat, classfiles):
7171

7272

7373

74-
SLEEP=120
74+
SLEEP=180
7575
YAML="yaml"
7676
JSON="json"
7777

@@ -214,12 +214,40 @@ def writeScript(basedir, code, port, tool, sut):
214214
def dockerId(port):
215215
return "id"+str(port)
216216

217+
def getWaitForSutFunction():
218+
s = "wait_for_sut() {\n"
219+
s += " local host_port=\"$1\"\n"
220+
s += " local max_wait=\"${2:-600}\"\n"
221+
s += " local interval=10\n"
222+
s += " local elapsed=0\n"
223+
s += "\n"
224+
s += " echo \"Waiting for SUT on port $host_port (max: ${max_wait}s)...\"\n"
225+
s += "\n"
226+
s += " while [ $elapsed -lt $max_wait ]; do\n"
227+
s += " sleep $interval\n"
228+
s += " elapsed=$((elapsed + interval))\n"
229+
s += "\n"
230+
s += " http_code=$(curl -s -o /dev/null -w \"%{http_code}\" --connect-timeout 5 --max-time 10 \"http://localhost:$host_port\" 2>/dev/null)\n"
231+
s += " if [ -n \"$http_code\" ] && [ \"$http_code\" -ge 100 ] 2>/dev/null; then\n"
232+
s += " echo \"SUT is ready after ${elapsed}s (HTTP $http_code on port $host_port)\"\n"
233+
s += " return 0\n"
234+
s += " fi\n"
235+
s += "\n"
236+
s += " echo \"Still waiting... ${elapsed}s / ${max_wait}s (port $host_port not responding)\"\n"
237+
s += " done\n"
238+
s += "\n"
239+
s += " echo \"WARNING: Timeout after ${max_wait}s, proceeding anyway...\"\n"
240+
s += "}\n\n"
241+
return s
242+
217243
def getScriptHead(port,tool,sut, exec_dir):
218244
s = ""
219245
s += "#!/bin/bash \n\n"
220246
s += "SUT=\"" + WFD_DIR + "/dockerfiles/"+sut.name+".yaml\" \n"
221247
s += "\n"
222248

249+
s += getWaitForSutFunction()
250+
223251
# These environment variables are read inside Docker Compose
224252
# Must be on same line of docker, so that why using \.
225253
# Note: there must be NOTHING after the \, not even empty space " "...
@@ -234,8 +262,8 @@ def getScriptHead(port,tool,sut, exec_dir):
234262
# Start SUT with Docker Compose
235263
s += "docker-compose --project-name "+dockerId(port)+" -f $SUT up --build --force-recreate " + getRedirectLog(getLogFile("sut",tool,sut.name,port)) + " & \n\n"
236264

237-
# No easy way to check if all is up and running, so wait for enough time before fuzzing
238-
s += "sleep " + str(sut.sleep) +"\n\n"
265+
# Wait until HTTP endpoint on target port responds (or timeout)
266+
s += "wait_for_sut " + str(port) + " " + str(sut.sleep) + "\n\n"
239267

240268
return s
241269

experiments/wb-exp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def addJobBody(port, sut, seed, setting, configName):
582582
else:
583583
label += "_" + str(ps[1])
584584

585+
params += " --blackBox false"
585586
params += " --testSuiteFileName=EM_" + sut.name.replace("-","_") + label + "_" + str(seed) + "_Test"
586587
params += " --labelForExperiments=" + label
587588
params += " --labelForExperimentConfigs=" + configName

jdk_11_gradle/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
allprojects {
33
ext {
4-
EVOMASTER_VERSION = "5.1.0"
4+
EVOMASTER_VERSION = "6.0.0"
55
}
66
}

jdk_11_gradle/settings.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
rootProject.name = "emb_jdk_11_gradle"
22

33
include("cs:graphql:patio-api")
4-
include("em:embedded:graphql:patio-api")
5-
include("em:external:graphql:patio-api")
6-
74
include("cs:rest:reservations-api")
8-
include("em:embedded:rest:reservations-api")
9-
include("em:external:rest:reservations-api")
5+
6+
if (System.getenv("BUILD_EVOMASTER") != "false") {
7+
include("em:embedded:graphql:patio-api")
8+
include("em:external:graphql:patio-api")
9+
include("em:embedded:rest:reservations-api")
10+
include("em:external:rest:reservations-api")
11+
}

jdk_11_maven/cs/graphql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.evomaster</groupId>
77
<artifactId>evomaster-benchmark-jdk11-cs</artifactId>
8-
<version>4.2.0</version>
8+
<version>4.3.0</version>
99
</parent>
1010

1111
<artifactId>evomaster-benchmark-jdk11-cs-graphql</artifactId>

jdk_11_maven/cs/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.evomaster</groupId>
77
<artifactId>evomaster-benchmark-jdk11</artifactId>
8-
<version>4.2.0</version>
8+
<version>4.3.0</version>
99
</parent>
1010

1111
<artifactId>evomaster-benchmark-jdk11-cs</artifactId>

jdk_11_maven/cs/rest-gui/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.evomaster</groupId>
77
<artifactId>evomaster-benchmark-jdk11-cs</artifactId>
8-
<version>4.2.0</version>
8+
<version>4.3.0</version>
99
</parent>
1010

1111
<artifactId>evomaster-benchmark-jdk11-cs-rest-gui</artifactId>

jdk_11_maven/cs/rest/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.evomaster</groupId>
77
<artifactId>evomaster-benchmark-jdk11-cs</artifactId>
8-
<version>4.2.0</version>
8+
<version>4.3.0</version>
99
</parent>
1010

1111
<artifactId>evomaster-benchmark-jdk11-cs-rest</artifactId>

jdk_11_maven/em/embedded/graphql/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.evomaster</groupId>
77
<artifactId>evomaster-benchmark-jdk11-em-embedded</artifactId>
8-
<version>4.2.0</version>
8+
<version>4.3.0</version>
99
</parent>
1010

1111
<artifactId>evomaster-benchmark-jdk11-em-embedded-graphql</artifactId>

0 commit comments

Comments
 (0)