kselftest: update how to skip tests

Upstream kselftest updated how to generate the run_kselftest.sh script
and that broke how we wants hack us self in to skip tests, update to
solve it for now. Binary tests that hangs for more than 30seconds will
automatically be killed by the kselftest framework. The only reminding
thing until we can drop our skiplist completely is if scripts hangs.

Suggested-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
diff --git a/automated/linux/kselftest/kselftest.sh b/automated/linux/kselftest/kselftest.sh
index 4504191..5354204 100755
--- a/automated/linux/kselftest/kselftest.sh
+++ b/automated/linux/kselftest/kselftest.sh
@@ -151,7 +151,8 @@
     # shellcheck disable=SC2086
     for test_name in ${SKIPLIST}; do
         # shellcheck disable=SC2086
-        sed -i "/.\/${test_name}/c\echo \"selftests: ${test_name} [SKIP]\"" run_kselftest.sh
+        sed -e ':a;N;$!ba;s/\n/@/g' -e 's/\t\\\@\t\"'${test_name}'\"//' -e 's/@/\n/g' -i run_kselftest.sh
+        echo "selftests: tmpskipdir: ${test_name}" >> target_skipfile.txt
     done
 fi
 
@@ -160,10 +161,16 @@
     while read -r test_name; do
         case "${test_name}" in \#*) continue ;; esac
         # shellcheck disable=SC2086
-        sed -i "/.\/${test_name}/c\echo \"selftests: ${test_name} [SKIP]\"" run_kselftest.sh
+        sed -e ':a;N;$!ba;s/\n/@/g' -e 's/\t\\\@\t\"'${test_name}'\"//' -e 's/@/\n/g' -i run_kselftest.sh
+        echo "selftests: tmpskipdir: ${test_name}" >> target_skipfile.txt
     done < "${SKIPFILE}"
 fi
 
+echo "========================================"
+echo "skiplist:"
+cat target_skipfile.txt
+echo ""
+echo "========================================"
 # run_kselftest.sh file generated by kselftest Makefile and included in tarball
 ./run_kselftest.sh 2>&1 | tee "${LOGFILE}" | sed 's/^not ok/[FAIL]/'|sed 's/^ok/[PASS]/'|sed 's/://g'|awk '{if ($0 ~ "# SKIP") {$1 = "[SKIP]"} print $0"\n"$3 ": " $4"_"$5 " " $1}'
 parse_output