Use the Unix /dev/zero device (which produces an infinite stream of bytes with value zero) together with the dd block copier to create files of any length, useful for testing.
dd if=/dev/zero of=test.bin bs=1024\*1024 count=4
… creates a file called test.bin (output file) by copying from /dev/zero (input file). Blocksize is 1 MB (1024*1024 bytes), and the count is 4, giving a 4 MB file. Substitute your own values for blocksize and count, and create test files of any length.