1 """ Send junk to the collector """
4 from .common import send_and_drain, TestWithServers, Fuzz
10 def test_msgs(self) -> None:
12 self.rnd.randint(1000000000, 9999999999) for _ in range(3)
14 for _ in range(REPEAT):
15 base_size = self.rnd.randint(0, 5000)
17 (self.rnd.randint(-5, 5) // 5) * self.rnd.randint(1, 20)
21 imei = f"{self.rnd.choice(imeis):d}".encode("ascii")
22 commapos = self.rnd.randint(0, 10)
23 if commapos > 0 and commapos < base_size:
25 self.rnd.randbytes(commapos - 1)
27 + self.rnd.randbytes(base_size - commapos)
30 payload = self.rnd.randbytes(base_size)
31 # print(imei, base_size, size)
32 # "\[(\w\w)\*(\d{10})\*([0-9a-fA-F]{4})\*"
37 + f"{size:04x}".encode("ascii")
39 + self.rnd.randbytes(base_size)
42 # print(buf[:64], "len:", len(buf))
43 send_and_drain(self.sock, buf)
46 if __name__ == "__main__":