From 628187af87a39648be8d24469c5f7ea710549a6d Mon Sep 17 00:00:00 2001 From: Shital Savekar Date: Wed, 18 Apr 2018 14:21:34 -0700 Subject: [PATCH] Fixing minor issues 1. Fixed issue in creating SQL query to upload multi test results. 2. Fixed Debian distro detection. 3. Added detection of Clear Linux OS. 4. Reduced timeout for 'dmesg' command. 5. Replaced write-host with LogMsg function to record logs. --- AzureTestSuite.ps1 | 4 ++-- TestLibs/LISALibrary.psm1 | 4 ++-- TestLibs/RDFELibs.psm1 | 15 +++++++-------- remote-scripts/CollectLogFile.sh | 14 +++++++++----- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/AzureTestSuite.ps1 b/AzureTestSuite.ps1 index 0817e3c..81a1ba1 100644 --- a/AzureTestSuite.ps1 +++ b/AzureTestSuite.ps1 @@ -467,6 +467,7 @@ Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $testIterations ) $dbpassword = $xmlSecrets.secrets.DatabasePassword $database = $xmlSecrets.secrets.DatabaseName $dataTableName = "AzureTestResultsMasterTable" + $dbTestName = $($currentTestData.testName) $SQLQuery = "INSERT INTO $dataTableName (DateTimeUTC,Environment,TestCycle,ExecutionID,TestName,TestResult,ARMImage,OsVHD,KernelVersion,LISVersion,GuestDistro,AzureHost,Location,OverrideVMSize,Networking,LogFile,BuildURL) VALUES " if ($testMode -eq "multi") { @@ -478,13 +479,12 @@ Function RunTestsOnCycle ($cycleName , $xmlConfig, $Distro, $testIterations ) $tempResult = $tempResult.Trim().Replace("
`hostname`-distroVersion.txt -elif [[ "$release" =~ "UBUNTU" ]] || [[ "$release" =~ "Ubuntu" ]] ; then +elif [[ "$release" =~ "UBUNTU" ]] || [[ "$release" =~ "Ubuntu" ]] || [[ "$release" =~ "Debian" ]]; then NAME=`cat /etc/os-release | grep ^NAME= | sed 's/"//g' | sed 's/NAME=//g'` VERSION=`cat /etc/os-release | grep ^VERSION= | sed 's/"//g' | sed 's/VERSION=//g'` echo "$NAME $VERSION" > `hostname`-distroVersion.txt - -elif [[ "$release" =~ "Debian" ]] ; then - cat /etc/os-release | grep "ID=" | sed 's/ID=//g' > `hostname`-distroVersion.txt +elif [ -e /usr/share/clear/version ]; then + NAME=`cat /usr/lib/os-release | grep ^PRETTY_NAME | sed 's/"//g' | sed 's/PRETTY_NAME=//g'` + VERSION=`cat /usr/lib/os-release | grep ^VERSION= | sed 's/"//g' | sed 's/VERSION=//g'` + echo "$NAME $VERSION" > `hostname`-distroVersion.txt +else + echo "unknown" > `hostname`-distroVersion.txt + echo $release > `hostname`-unknownDistro.txt fi -exit 0 +exit 0 \ No newline at end of file