]> www.average.org Git - loctrkd.git/blobdiff - test/test_fuzz_zx303.py
tests: separate fuzz tests in two modules
[loctrkd.git] / test / test_fuzz_zx303.py
diff --git a/test/test_fuzz_zx303.py b/test/test_fuzz_zx303.py
new file mode 100644 (file)
index 0000000..4878f0e
--- /dev/null
@@ -0,0 +1,18 @@
+""" Send junk to the collector """
+
+import unittest
+from .common import send_and_drain, TestWithServers, Fuzz
+
+REPEAT: int = 1000000
+
+
+class FuzzMsgs(Fuzz):
+    def test_msgs(self) -> None:
+        for _ in range(REPEAT):
+            size = self.rnd.randint(0, 300)
+            buf = b"xx" + self.rnd.randbytes(size) + b"\r\n"
+            send_and_drain(self.sock, buf)
+
+
+if __name__ == "__main__":
+    unittest.main()