]> www.average.org Git - loctrkd.git/blobdiff - test/test_fuzz_stream.py
tests: separate fuzz tests in two modules
[loctrkd.git] / test / test_fuzz_stream.py
diff --git a/test/test_fuzz_stream.py b/test/test_fuzz_stream.py
new file mode 100644 (file)
index 0000000..64c5a9f
--- /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 FuzzStream(Fuzz):
+    def test_stream(self) -> None:
+        for _ in range(REPEAT):
+            size = self.rnd.randint(1, 5000)
+            buf = self.rnd.randbytes(size)
+            send_and_drain(self.sock, buf)
+
+
+if __name__ == "__main__":
+    unittest.main()