Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/cmd/functional-test/run.sh
2070 views
1
#!/bin/bash
2
3
if [ "${RUNNER_OS}" == "Windows" ]; then
4
EXT=".exe"
5
elif [ "${RUNNER_OS}" == "macOS" ]; then
6
if [ "${CI}" == "true" ]; then
7
sudo sysctl -w kern.maxfiles{,perproc}=524288
8
sudo launchctl limit maxfiles 65536 524288
9
fi
10
11
ORIGINAL_ULIMIT="$(ulimit -n)"
12
ulimit -n 65536 || true
13
fi
14
15
mkdir -p .nuclei-config/nuclei/
16
touch .nuclei-config/nuclei/.nuclei-ignore
17
18
echo "::group::Building functional-test binary"
19
go build -o "functional-test${EXT}"
20
echo "::endgroup::"
21
22
echo "::group::Building Nuclei binary from current branch"
23
go build -o "nuclei-dev${EXT}" ../nuclei
24
echo "::endgroup::"
25
26
echo "::group::Building latest release of nuclei"
27
go build -o "nuclei${EXT}" -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei
28
echo "::endgroup::"
29
30
echo "::group::Installing nuclei templates"
31
eval "./nuclei-dev${EXT} -update-templates"
32
echo "::endgroup::"
33
34
echo "::group::Validating templates"
35
eval "./nuclei-dev${EXT} -validate"
36
echo "::endgroup::"
37
38
echo "Starting Nuclei functional test"
39
eval "./functional-test${EXT} -main ./nuclei${EXT} -dev ./nuclei-dev${EXT} -testcases testcases.txt"
40
41
if [ "${RUNNER_OS}" == "macOS" ]; then
42
ulimit -n "${ORIGINAL_ULIMIT}" || true
43
fi
44
45