rewrite the script so that it can auto do the test function in the beginning and transfer the result to the host