Revert "1.slight adjust the test order"
This reverts commit 48214b1980
.
This commit is contained in:
Родитель
ed75d9a2cb
Коммит
7a6c00f6d5
|
@ -3326,6 +3326,9 @@
|
|||
<test>
|
||||
<Name>BVT-VERIFY-NO-ERROR-IN-LOGS</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-VERBOSE-ENABLED-LOGS</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-VHD-PREREQUISITES</Name>
|
||||
</test>
|
||||
|
@ -3389,9 +3392,6 @@
|
|||
<test>
|
||||
<Name>BVT-VERIFY-SSHD-CONFIG</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-VERBOSE-ENABLED-LOGS</Name>
|
||||
</test>
|
||||
<test>
|
||||
<Name>BVT-VERIFY-SHUTDOWN</Name>
|
||||
</test>
|
||||
|
|
|
@ -5,7 +5,6 @@ from azuremodules import *
|
|||
|
||||
import argparse
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
#for error checking
|
||||
parser = argparse.ArgumentParser()
|
||||
|
@ -27,9 +26,7 @@ def RunTest(expectedvalue):
|
|||
UpdateState("TestCompleted")
|
||||
else :
|
||||
RunLog.error('Verify log waagent.log fail. Current value : %s Expected value : %s' % (output, expectedvalue))
|
||||
errorInfo = Run("grep -i error /var/log/waagent.log")
|
||||
RunLog.error('error Info from waagent.log as below: \n' + errorInfo)
|
||||
ResultLog.error('FAIL')
|
||||
UpdateState("TestCompleted")
|
||||
|
||||
RunTest(expectedValue)
|
||||
RunTest(expectedValue)
|
|
@ -7,29 +7,20 @@ import argparse
|
|||
import sys
|
||||
import time
|
||||
import platform
|
||||
import os
|
||||
#for error checking
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument('-e', '--expected', help='specify expected value', required=True)
|
||||
|
||||
args = parser.parse_args()
|
||||
#if no value specified then stop
|
||||
expectedValue = "1"
|
||||
def RunTest(expectedvalue):
|
||||
def RunTest():
|
||||
UpdateState("TestRunning")
|
||||
RunLog.info("Checking log waagent.log...")
|
||||
temp = Run("grep -i 'iptables -I INPUT -p udp --dport' /var/log/waagent* | wc -l | tr -d '\n'")
|
||||
output = temp
|
||||
|
||||
if (expectedvalue == output) :
|
||||
RunLog.info('The log file contains the expected value')
|
||||
output = Run("grep -i 'iptables -I INPUT -p udp --dport' /var/log/waagent* | wc -l | tr -d '\n'")
|
||||
if not (output == "0") :
|
||||
RunLog.info('The log file contains the verbose logs')
|
||||
ResultLog.info('PASS')
|
||||
UpdateState("TestCompleted")
|
||||
else :
|
||||
RunLog.error('Verify waagent.log fail. Current value : %s Expected value : %s' % (output, expectedvalue))
|
||||
RunLog.error('Verify waagent.log fail, the log file does not contain the verbose logs')
|
||||
ResultLog.error('FAIL')
|
||||
UpdateState("TestCompleted")
|
||||
|
||||
def Restartwaagent():
|
||||
distro = platform.dist()
|
||||
if (distro[0] == "CoreOS") :
|
||||
|
@ -40,12 +31,12 @@ def Restartwaagent():
|
|||
result = Run("echo 'Redhat.Redhat.777' | sudo -S find / -name systemctl |wc -l | tr -d '\n'")
|
||||
if (distro[0] == "Ubuntu") :
|
||||
Run("echo 'Redhat.Redhat.777' | sudo -S service walinuxagent restart")
|
||||
else :
|
||||
#for distro: centos6,oracle6 it will be hung when call Run,so use os.system() to replace it
|
||||
else :
|
||||
if (result == "0") :
|
||||
os.system("echo 'Redhat.Redhat.777' | sudo -S service waagent restart")
|
||||
Run("echo 'Redhat.Redhat.777' | sudo -S service waagent restart")
|
||||
else :
|
||||
os.system("echo 'Redhat.Redhat.777' | sudo -S systemctl restart waagent")
|
||||
Run("echo 'Redhat.Redhat.777' | sudo -S systemctl restart waagent")
|
||||
time.sleep(60)
|
||||
|
||||
Restartwaagent()
|
||||
time.sleep(60)
|
||||
RunTest(expectedValue)
|
||||
RunTest()
|
||||
|
|
Загрузка…
Ссылка в новой задаче