Fix restarting of internal tester
Before we would do one run on master with the old commands and
timeouts before restarting (if we previously ran on a branch).
I will merge this to the branches as well, to give us test coverage
there (the same thing happens, we run once with the commands/timeout
from master)
Change-Id: If9e841980e0757899a579244a78c11e39ca042b1
diff --git a/tools/internal_test.py b/tools/internal_test.py
index 5bf1da2..a9a90eb 100755
--- a/tools/internal_test.py
+++ b/tools/internal_test.py
@@ -235,6 +235,10 @@
if get_magic_file_exists(READY_FOR_TESTING):
git_hash = get_magic_file_content(READY_FOR_TESTING)
checked_out = git_checkout(git_hash)
+ # If the script changed, we need to restart now to get correct commands
+ # Note that we have not removed the READY_FOR_TESTING yet, so if we
+ # execv we will pick up the same version.
+ restart_if_new_version(own_content)
# Sanity check, if this does not succeed stop.
if checked_out != git_hash:
log('Inconsistent state: %s %s' % (git_hash, checked_out))