From f2c2b09b9e511421c5aad4adec71d948897a4b06 Mon Sep 17 00:00:00 2001 From: Nidylei Date: Tue, 15 Sep 2015 15:38:30 +0800 Subject: [PATCH] fix compatibility with distro using python3 to run agent and do some minor fix --- TestLibs/RDFELibs.psm1 | 2 +- remote-scripts/BVT-WA-VER-CHECK.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/TestLibs/RDFELibs.psm1 b/TestLibs/RDFELibs.psm1 index 0c12cc9..57cbdd1 100644 --- a/TestLibs/RDFELibs.psm1 +++ b/TestLibs/RDFELibs.psm1 @@ -2290,7 +2290,7 @@ Function DoTestCleanUp($result, $testName, $DeployedServices, $ResourceGroups, [ LogMsg "Cleaning up deployed test virtual machines." $isClened = DeleteResourceGroup -RGName $group - if ($isClened) + if (!$isClened) { LogMsg "CleanUP unsuccessful for $group.. Please delete the services manually." } diff --git a/remote-scripts/BVT-WA-VER-CHECK.py b/remote-scripts/BVT-WA-VER-CHECK.py index e29eebf..e83926f 100644 --- a/remote-scripts/BVT-WA-VER-CHECK.py +++ b/remote-scripts/BVT-WA-VER-CHECK.py @@ -33,4 +33,8 @@ def RunTest(command): if(distro == "COREOS"): RunTest("waagent --version") else: - RunTest("/usr/sbin/waagent --version") \ No newline at end of file + output = Run("ps aux | grep waagent | grep python | grep -v 'ps aux | grep waagent | grep python'") + if ("python3" in output) : + RunTest("/usr/bin/python3 /usr/sbin/waagent --version") + else : + RunTest("/usr/sbin/waagent --version") \ No newline at end of file