Replace usage of $RANDOM in test scripts.