Tests passing
This commit is contained in:
@@ -2,3 +2,4 @@
|
|||||||
*.a
|
*.a
|
||||||
example_simple
|
example_simple
|
||||||
connection_afl
|
connection_afl
|
||||||
|
findings
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ firecgi.a: $(objects)
|
|||||||
ar rcs $@ $^
|
ar rcs $@ $^
|
||||||
|
|
||||||
example_simple: example_simple.o $(objects)
|
example_simple: example_simple.o $(objects)
|
||||||
|
$(MAKE) --directory=firebuf
|
||||||
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ firebuf/firebuf.a $(FIRE_LDLIBS)
|
$(FIRE_CXX) $(FIRE_CXXFLAGS) -o $@ $+ firebuf/firebuf.a $(FIRE_LDLIBS)
|
||||||
|
|
||||||
%.o: %.cc *.h Makefile
|
%.o: %.cc *.h Makefile
|
||||||
@@ -27,11 +28,12 @@ afl:
|
|||||||
afl_int: connection_afl
|
afl_int: connection_afl
|
||||||
|
|
||||||
connection_afl: connection_afl.o $(objects)
|
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: test_connection
|
||||||
|
|
||||||
test_connection: connection_afl_afl
|
test_connection: connection_afl
|
||||||
@echo "Running $$(ls afl_state/testcases | wc -l) tests"
|
@echo "Running $$(ls testcases | wc -l) tests"
|
||||||
for FILE in afl_state/testcases/*; do ./connection_afl < $$FILE; done
|
for FILE in testcases/*; do ./connection_afl < $$FILE; done
|
||||||
@printf '\033[0;32mALL TESTS PASSED\033[0m\n'
|
@printf '\033[0;32mALL TESTS PASSED\033[0m\n'
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash -ex
|
||||||
|
|
||||||
|
cd $(dirname $0)
|
||||||
|
|
||||||
|
make afl
|
||||||
|
afl-fuzz -i testcases -o findings -- ./connection_afl
|
||||||
@@ -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