--- /dev/null
+#!/bin/bash
+
+user=
+password=
+
+usage()
+{
+ echo "Usage: $0 --device=[name] --target=[mobile|tv] --version=[version] --skiprpminstall"
+ echo "--device - If there are more than one target,"
+ echo " you should pass the device name by using 'sdb devices' command"
+ echo "--target - Target device type (i.e. mobile, tv)"
+ echo "--version - You can add the specific binary version name."
+ echo " The name should can be found under http://165.213.149.200/download/public_mirror/tizen/"
+ echo " like tizen-mobile_20170215.2."
+ echo " Default is a latest repository."
+ echo "--skiprpminstall - Do not install rpm files"
+ exit 1
+}
+
+repo_url="http://165.213.149.200/download/public_mirror/tizen"
+
+arm_pkgs="target-TM1/packages/armv7l/"
+x86_64_pkgs="emulator64-wayland/packages/x86_64/"
+
+check_valid_url()
+{
+ status=$( curl -u $user:$password -s --head -w %{http_code} $1 -o /dev/null )
+ if [[ $status != 200 ]]; then
+ echo "Invalid webpage. (url=$1)"
+ exit 1
+ fi
+}
+
+opt="-d"
+devicetype=
+version="latest"
+skipinstall=0
+
+for i in "$@"
+do
+ if [ $# -le 0 ]; then
+ break
+ fi
+
+ case $i in
+ -h|--help)
+ usage
+ exit 1
+ ;;
+ --device=*)
+ opt="-s "${i#*=}
+ ;;
+ --target=*)
+ devicetype=${i#*=}
+ ;;
+ --version=*)
+ version=${i#*=}
+ ;;
+ --skiprpminstall)
+ skiprpminstall=1
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+clrdir="/opt/usr/coreclr-tc"
+
+sdb ${opt} root on
+
+if [ $? != 0 ]; then
+ exit 1
+fi
+
+str=$( sdb ${opt} shell "uname -a" )
+if [[ $str == *"x86_64"* ]]; then
+ target=x86_64
+ tcarch=x64
+ pkg=$x86_64_pkgs
+elif [[ $str == *"armv7l"* ]]; then
+ target=armv7l
+ tcarch=x86
+ pkg=$arm_pkgs
+else
+ echo "not support target $str"
+ exit 1
+fi
+
+sdb ${opt} shell rm -rf $clrdir
+sdb ${opt} shell mkdir -p ${clrdir}
+
+if [ $skiprpminstall == 0 ]; then
+ echo "Target arch : ${target}"
+ echo "Check valid repository url"
+ url=$repo_url"/"$devicetype"/"$version"/repos/"$pkg
+ check_valid_url $url
+
+ echo -e " \n\n---- Donwload coreclr-test-*.rpm ----"
+ wget -r --no-parent -nd -R 'index.html*' -R '*debug*' -P rpms -A 'coreclr-test-*.rpm' $url --http-user=$user --http-password=$password
+
+ echo -e "\n\n---- Install rpm files ----"
+ tmpdir="$clrdir/tmp"
+ sdb ${opt} shell mkdir -p $tmpdir
+ sdb ${opt} push rpms/*.${target}.rpm $tmpdir
+ sdb ${opt} shell rpm -ivh --force $tmpdir/*.rpm
+ sdb ${opt} shell rm -rf $tmpdir
+ rm -rf rpms/coreclr-test-*.rpm
+fi
+
+echo -e "\n\n---- Download CoreCLR TC ----"
+tc_url="http://10.113.63.27:8080/job/CLR/job/"$tcarch"_Rel_CLEARED_TC_Pri2/lastSuccessfulBuild/artifact/output/testcases.bin.tgz"
+wget $tc_url
+
+echo -e "\n\n---- Install CoreCLR TC ----"
+sdb ${opt} push testcases.bin.tgz $clrdir
+sdb ${opt} shell mkdir -p $clrdir/Windows_NT.${tcarch}.Release
+sdb ${opt} shell tar xvzf $clrdir/testcases.bin.tgz -C $clrdir/Windows_NT.${tcarch}.Release
+sdb ${opt} shell rm $clrdir/testcases.bin.tgz
+rm testcases.bin.tgz
+
+echo -e "\n\n---- Checkout runtest.sh from master branch ----"
+git checkout tizen -- ./tests/runtest.sh
+git checkout tizen -- ./tests/tests*.txt
+git checkout tizen -- ./tests/setup-runtime-dependencies.sh
+sdb ${opt} push ./tests/* $clrdir
+rm -rf ./tests
+
+echo -e "\n\n---- Create TC Overlay ----"
+overlaydir="$clrdir/overlay"
+sdb ${opt} shell mkdir -p $overlaydir
+sdb ${opt} shell cp -rf $clrdir/Windows_NT.${tcarch}.Release/Tests/Core_Root/* $overlaydir
+sdb ${opt} shell cp -L /usr/share/tizen.net/* $overlaydir
+sdb ${opt} shell cp -L /usr/share/dotnet.tizen/framework/* $overlaydir
+# runtest.sh does not consider link files so copy directly
+sdb ${opt} shell find /usr/share/dotnet.tizen/test/ -name "*.so" -exec cp {} $overlaydir \\\;
+sdb ${opt} shell chmod 644 $overlaydir/*.dll $overlaydir/*.so
+
+sdb ${opt} shell sync
+
+echo -e "\n\n---- Finish ----"
+echo -e "CoreOverlay dir : $overlaydir"
+echo -e "How to run CoreCLR TC : "
+echo -e "# cd $clrdir"
+echo -e "# ./runtest.sh --testRootDir=$clrdir/Windows_NT.${tcarch}.Release \\"
+echo -e "> --testNativeBinDir=/usr/share/dotnet.tizen/test \\"
+echo -e "> --coreOverlayDir=$overlaydir -v --show-time | tee clr.log"
+echo -e "Output results : $clrdir/Windows_NT.${tcarch}.Release/coreclrtests.xml"
+echo -e "(You can use run.sh file in your host machine.)"
+echo -e "\nHow to convert useful csv file : "
+echo -e "(In host machine, not target)"
+echo -e "coreclr$ cd script"
+echo -e "coreclr/script$ ./get_clr_results.sh"
--- /dev/null
+#!/bin/bash
+
+usage()
+{
+ echo "Usage: $0 [device-name] --postfix=###"
+ echo "device-name - You can get the name by using 'sdb devices' command"
+ exit 1
+}
+
+opt="-d"
+postfix=''
+
+for i in "$@"
+do
+ if [ $# -le 0 ]; then
+ break
+ fi
+
+ case $i in
+ -h|--help)
+ usage
+ exit 1
+ ;;
+ --postfix=*)
+ postfix="_"${i#*=}
+ ;;
+ *)
+ opt="-s ${i#*}"
+ ;;
+ esac
+ shift
+done
+
+sdb ${opt} root on
+
+str=$( sdb ${opt} shell "uname -a" )
+if [[ $str == *"x86_64"* ]]; then
+ tcarch=x64
+elif [[ $str == *"armv7l"* ]]; then
+ tcarch=x86
+else
+ echo "not support target $str"
+ exit 1
+fi
+
+sdb ${opt} pull /etc/info.ini .
+version=$(awk -F "=" '/Build/ {print $2}' ./info.ini)
+version=${version%?}
+rm -rf ./info.ini
+
+clrdir="/opt/usr/coreclr-tc"
+name="CoreCLR_UnitTest_Results_"$version$postfix
+
+sdb ${opt} pull $clrdir/Windows_NT.${tcarch}.Release/coreclrtests.xml $name.xml
+sdb ${opt} pull $clrdir/clr.log $name.log
+
+if [ -f $name.xml ]; then
+ ./generate_clr_csv $name.xml
+fi
+