Add test for random module that checks platform in order to pass test an...

...d avoid issues in #5999