old_contents: #!/usr/bin/python
  
  from azuremodules import *
  
  def RunTest(command):
      UpdateState("TestRunning")
      RunLog.info("Checking WALinuxAgent in running processes")
      temp = Run(command)
      timeout = 0
      output = temp
      if ("waagent" in output) :
                      RunLog.info('waagent service present in running processes')
                      ResultLog.info('PASS')
                      UpdateState("TestCompleted")
      else:
                      RunLog.error('waagent service absent in running processes')
                      ResultLog.Error('FAIL')
                      UpdateState("TestCompleted")
          
  RunTest("ps -ef | grep waagent | grep -v grep")
  
new_contents: #!/usr/bin/python
  
  from azuremodules import *
  
  def RunTest(command):
      UpdateState("TestRunning")
      RunLog.info("Checking WALinuxAgent in running processes")
      temp = RunUpdate(command)
      timeout = 0
      output = temp
      if ("waagent" in output) :
                      RunLog.info('waagent service present in running processes')
                      ResultLog.info('PASS')
                      UpdateState("TestCompleted")
      else:
                      RunLog.error('waagent service absent in running processes')
                      ResultLog.Error('FAIL')
                      UpdateState("TestCompleted")
          
  RunTest("ps -ef | grep waagent | grep -v grep")
  
subject: fix issue that hang on call method Run('ps -ef | grep waagent') for some distros,use method RunUpdate() to replaced