Create a file and define its size

#> touch /tmp/testfs-OST0000
#> truncate -s 10G /tmp/testfs-OST0000 

Use /tmp/testfs-OST0000  as the device name when formatting and mounting

Of course, the "10G" size will depend on how much RAM you have on the node, since /tmp is normally tmpfs which is RAM based. It'll swap out of RAM if RAM is running low

The file can be located anywhere, but tmpfs is fastest.

Test filesystems can be as small as maybe 200M or so, just to get basic functionality

(and will mostly be sparse unless you write large files into them)