From ebce840412da0de690fab82c6968663a959cdfd0 Mon Sep 17 00:00:00 2001 From: "yang.zhang" Date: Thu, 30 Jul 2015 17:03:00 +0800 Subject: [PATCH] modify sudo pattern formt for fedora20-i586 to avoid internal error in regular expression engine Change-Id: Ia58af3aca383f8eb402557fa8e8b300cbb17a740 --- itest/case.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/itest/case.py b/itest/case.py index 0237aca..de3511a 100644 --- a/itest/case.py +++ b/itest/case.py @@ -2,6 +2,7 @@ import os import sys import time import uuid +import platform try: import unittest2 as unittest @@ -96,6 +97,8 @@ SUDO_PASS_PROMPT_PATTERN = "\[sudo\] password for .*?:|" \ "root's password:|" \ ".*?'s password:" +SUDO_PASS_PROMPT_PATTERN_FEDORA_20_i586 = "\[sudo\] password for .*?:|" \ + "root's password:" class Tee(object): @@ -253,7 +256,14 @@ set -x return path def _psh(self, script, more_expecting=()): - expecting = [(SUDO_PASS_PROMPT_PATTERN, settings.SUDO_PASSWD)] + \ + if (platform.linux_distribution()[0] == 'Fedora') and \ + (platform.linux_distribution()[1] == '20') and \ + (platform.architecture()[0] == '32bit'): + pat = SUDO_PASS_PROMPT_PATTERN_FEDORA_20_i586 + else: + pat = SUDO_PASS_PROMPT_PATTERN + + expecting = [(pat, settings.SUDO_PASSWD)] + \ list(more_expecting) try: return pcall('/bin/bash', -- 2.7.4