fix(ci): run configs correctly with dont_clean

If we do nothing, expect will read the last run's output and produce the
same result (and sometimes failing because we killed the model too
early). So clean the run directories to make sure we run again.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I4ae5bfa34b05e7006a6ab9140c20024f9ee8c445
diff --git a/script/run_package.sh b/script/run_package.sh
index b89c4a6..25bc287 100755
--- a/script/run_package.sh
+++ b/script/run_package.sh
@@ -21,6 +21,13 @@
 # Model exit parameter string
 model_exit_param_string="bp.pl011_uart0.shutdown_on_eot=1"
 
+# since expect and the model run in parallel, expect might read the old run's
+# files before the model has had a chance to clear them. Clear all run artefacts
+# ahead of time to be sure everything is fresh
+if upon $dont_clean; then
+	rm -rf "$run_root" "$pid_dir"
+fi
+
 mkdir -p "$pid_dir"
 mkdir -p "$run_root"