Tests passing
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
||||
*.a
|
||||
example_simple
|
||||
connection_afl
|
||||
findings
|
||||
|
||||
10
Makefile
10
Makefile
@@ -11,6 +11,7 @@ firecgi.a: $(objects)
|
||||
ar rcs $@ $^
|
||||
|
||||
example_simple: example_simple.o $(objects)
|
||||
$(MAKE) --directory=firebuf
|
||||
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ firebuf/firebuf.a $(FIRE_LDLIBS)
|
||||
|
||||
%.o: %.cc *.h Makefile
|
||||
@@ -27,11 +28,12 @@ afl:
|
||||
afl_int: connection_afl
|
||||
|
||||
connection_afl: connection_afl.o $(objects)
|
||||
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ $(FIRE_LDLIBS)
|
||||
$(MAKE) --directory=firebuf
|
||||
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ firebuf/firebuf.a $(FIRE_LDLIBS)
|
||||
|
||||
test: test_connection
|
||||
|
||||
test_connection: connection_afl_afl
|
||||
@echo "Running $$(ls afl_state/testcases | wc -l) tests"
|
||||
for FILE in afl_state/testcases/*; do ./connection_afl < $$FILE; done
|
||||
test_connection: connection_afl
|
||||
@echo "Running $$(ls testcases | wc -l) tests"
|
||||
for FILE in testcases/*; do ./connection_afl < $$FILE; done
|
||||
@printf '\033[0;32mALL TESTS PASSED\033[0m\n'
|
||||
|
||||
6
afl.sh
Executable file
6
afl.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
cd $(dirname $0)
|
||||
|
||||
make afl
|
||||
afl-fuzz -i testcases -o findings -- ./connection_afl
|
||||
18
connection_afl.cc
Normal file
18
connection_afl.cc
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "connection.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
FLAGS_logtostderr = 1;
|
||||
FLAGS_minloglevel = 3;
|
||||
google::InitGoogleLogging(argv[0]);
|
||||
gflags::ParseCommandLineFlags(&argc, &argv, true);
|
||||
|
||||
{
|
||||
firecgi::Connection conn(STDIN_FILENO, {}, [](std::unique_ptr<firecgi::Request> req) { req->End(); }, {});
|
||||
static_cast<void>(conn.Read());
|
||||
}
|
||||
|
||||
gflags::ShutDownCommandLineFlags();
|
||||
google::ShutdownGoogleLogging();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user