Commit f0fb1bd6 authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): forcing no colour on grep commands

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 4fabb70c
...@@ -222,7 +222,7 @@ class Containerize(): ...@@ -222,7 +222,7 @@ class Containerize():
if (self.ranAllowMerge): if (self.ranAllowMerge):
imageTag = 'ci-temp' imageTag = 'ci-temp'
if self.ranTargetBranch == 'develop': if self.ranTargetBranch == 'develop':
mySSH.command('git diff HEAD..origin/develop -- docker/Dockerfile.ran' + self.dockerfileprefix + ' | grep -i INDEX', '\$', 5) mySSH.command('git diff HEAD..origin/develop -- docker/Dockerfile.ran' + self.dockerfileprefix + ' | grep --colour=never -i INDEX', '\$', 5)
result = re.search('index', mySSH.getBefore()) result = re.search('index', mySSH.getBefore())
if result is not None: if result is not None:
forceSharedImageBuild = True forceSharedImageBuild = True
...@@ -901,17 +901,17 @@ class Containerize(): ...@@ -901,17 +901,17 @@ class Containerize():
if svrName == 'porcepix': if svrName == 'porcepix':
mySSH.open(ipAddr, userName, password) mySSH.open(ipAddr, userName, password)
# Check if route to asterix gnb exists # Check if route to asterix gnb exists
mySSH.command('ip route | grep "192.168.68.64/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.64/26"', '\$', 10)
result = re.search('192.168.18.194', mySSH.getBefore()) result = re.search('192.168.18.194', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10)
# Check if route to obelix enb exists # Check if route to obelix enb exists
mySSH.command('ip route | grep "192.168.68.128/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10)
result = re.search('192.168.18.193', mySSH.getBefore()) result = re.search('192.168.18.193', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev eno1', '\$', 10)
# Check if route to nepes gnb exists # Check if route to nepes gnb exists
mySSH.command('ip route | grep "192.168.68.192/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.192/26"', '\$', 10)
result = re.search('192.168.18.209', mySSH.getBefore()) result = re.search('192.168.18.209', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10)
...@@ -929,17 +929,17 @@ class Containerize(): ...@@ -929,17 +929,17 @@ class Containerize():
if svrName == 'asterix': if svrName == 'asterix':
mySSH.open(ipAddr, userName, password) mySSH.open(ipAddr, userName, password)
# Check if route to porcepix epc exists # Check if route to porcepix epc exists
mySSH.command('ip route | grep "192.168.61.192/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10)
result = re.search('192.168.18.210', mySSH.getBefore()) result = re.search('192.168.18.210', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev em1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev em1', '\$', 10)
# Check if route to porcepix cn5g exists # Check if route to porcepix cn5g exists
mySSH.command('ip route | grep "192.168.70.128/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.70.128/26"', '\$', 10)
result = re.search('192.168.18.210', mySSH.getBefore()) result = re.search('192.168.18.210', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.70.128/26 via 192.168.18.210 dev em1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.70.128/26 via 192.168.18.210 dev em1', '\$', 10)
# Check if X2 route to obelix enb exists # Check if X2 route to obelix enb exists
mySSH.command('ip route | grep "192.168.68.128/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10)
result = re.search('192.168.18.193', mySSH.getBefore()) result = re.search('192.168.18.193', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev em1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev em1', '\$', 10)
...@@ -957,17 +957,17 @@ class Containerize(): ...@@ -957,17 +957,17 @@ class Containerize():
if svrName == 'obelix': if svrName == 'obelix':
mySSH.open(ipAddr, userName, password) mySSH.open(ipAddr, userName, password)
# Check if route to porcepix epc exists # Check if route to porcepix epc exists
mySSH.command('ip route | grep "192.168.61.192/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10)
result = re.search('192.168.18.210', mySSH.getBefore()) result = re.search('192.168.18.210', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev eno1', '\$', 10)
# Check if X2 route to asterix gnb exists # Check if X2 route to asterix gnb exists
mySSH.command('ip route | grep "192.168.68.64/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.64/26"', '\$', 10)
result = re.search('192.168.18.194', mySSH.getBefore()) result = re.search('192.168.18.194', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.64/26 via 192.168.18.194 dev eno1', '\$', 10)
# Check if X2 route to nepes gnb exists # Check if X2 route to nepes gnb exists
mySSH.command('ip route | grep "192.168.68.192/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.192/26"', '\$', 10)
result = re.search('192.168.18.209', mySSH.getBefore()) result = re.search('192.168.18.209', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.192/26 via 192.168.18.209 dev eno1', '\$', 10)
...@@ -985,12 +985,12 @@ class Containerize(): ...@@ -985,12 +985,12 @@ class Containerize():
if svrName == 'nepes': if svrName == 'nepes':
mySSH.open(ipAddr, userName, password) mySSH.open(ipAddr, userName, password)
# Check if route to porcepix epc exists # Check if route to porcepix epc exists
mySSH.command('ip route | grep "192.168.61.192/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.61.192/26"', '\$', 10)
result = re.search('192.168.18.210', mySSH.getBefore()) result = re.search('192.168.18.210', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev enp0s31f6', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.61.192/26 via 192.168.18.210 dev enp0s31f6', '\$', 10)
# Check if X2 route to obelix enb exists # Check if X2 route to obelix enb exists
mySSH.command('ip route | grep "192.168.68.128/26"', '\$', 10) mySSH.command('ip route | grep --colour=never "192.168.68.128/26"', '\$', 10)
result = re.search('192.168.18.193', mySSH.getBefore()) result = re.search('192.168.18.193', mySSH.getBefore())
if result is None: if result is None:
mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev enp0s31f6', '\$', 10) mySSH.command('echo ' + password + ' | sudo -S ip route add 192.168.68.128/26 via 192.168.18.193 dev enp0s31f6', '\$', 10)
......
...@@ -63,7 +63,7 @@ class Module_UE: ...@@ -63,7 +63,7 @@ class Module_UE:
#if not it will be started #if not it will be started
def CheckCMProcess(self,CNType): def CheckCMProcess(self,CNType):
HOST=self.HostUsername+'@'+self.HostIPAddress HOST=self.HostUsername+'@'+self.HostIPAddress
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep " COMMAND="ps aux | grep --colour=never " + self.Process['Name'] + " | grep -v grep "
logging.debug(COMMAND) logging.debug(COMMAND)
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
result = ssh.stdout.readlines() result = ssh.stdout.readlines()
...@@ -81,7 +81,7 @@ class Module_UE: ...@@ -81,7 +81,7 @@ class Module_UE:
#checking the process #checking the process
time.sleep(5) time.sleep(5)
HOST=self.HostUsername+'@'+self.HostIPAddress HOST=self.HostUsername+'@'+self.HostIPAddress
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep " COMMAND="ps aux | grep --colour=never " + self.Process['Name'] + " | grep -v grep "
logging.debug(COMMAND) logging.debug(COMMAND)
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
result = ssh.stdout.readlines() result = ssh.stdout.readlines()
...@@ -108,7 +108,7 @@ class Module_UE: ...@@ -108,7 +108,7 @@ class Module_UE:
response= [] response= []
tentative = 3 tentative = 3
while (len(response)==0) and (tentative>0): while (len(response)==0) and (tentative>0):
COMMAND="ip a show dev " + self.UENetwork + " | grep inet | grep " + self.UENetwork COMMAND="ip a show dev " + self.UENetwork + " | grep --colour=never inet | grep " + self.UENetwork
logging.debug(COMMAND) logging.debug(COMMAND)
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
response = ssh.stdout.readlines() response = ssh.stdout.readlines()
...@@ -136,7 +136,7 @@ class Module_UE: ...@@ -136,7 +136,7 @@ class Module_UE:
response= [] response= []
tentative = 3 tentative = 3
while (len(response)==0) and (tentative>0): while (len(response)==0) and (tentative>0):
COMMAND="ip a show dev " + self.UENetwork + " | grep mtu" COMMAND="ip a show dev " + self.UENetwork + " | grep --colour=never mtu"
logging.debug(COMMAND) logging.debug(COMMAND)
ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE) ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
response = ssh.stdout.readlines() response = ssh.stdout.readlines()
......
...@@ -192,16 +192,16 @@ class OaiCiTest(): ...@@ -192,16 +192,16 @@ class OaiCiTest():
result = re.search('LAST_BUILD_INFO', SSH.getBefore()) result = re.search('LAST_BUILD_INFO', SSH.getBefore())
if result is not None: if result is not None:
mismatch = False mismatch = False
SSH.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep --colour=never SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2)
result = re.search(self.ranCommitID, SSH.getBefore()) result = re.search(self.ranCommitID, SSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
SSH.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep --colour=never MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if self.ranAllowMerge: if self.ranAllowMerge:
result = re.search('YES', SSH.getBefore()) result = re.search('YES', SSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
SSH.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) SSH.command('grep --colour=never TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if self.ranTargetBranch == '': if self.ranTargetBranch == '':
result = re.search('develop', SSH.getBefore()) result = re.search('develop', SSH.getBefore())
else: else:
...@@ -660,7 +660,7 @@ class OaiCiTest(): ...@@ -660,7 +660,7 @@ class OaiCiTest():
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
count = 0 count = 0
while count < 5: while count < 5:
SSH.command('echo ' + self.ADBPassword + ' | sudo -S lsof | grep ttyUSB0', '\$', 10) SSH.command('echo ' + self.ADBPassword + ' | sudo -S lsof | grep --colour=never ttyUSB0', '\$', 10)
result = re.search('picocom', SSH.getBefore()) result = re.search('picocom', SSH.getBefore())
if result is None: if result is None:
count = 10 count = 10
...@@ -1328,7 +1328,7 @@ class OaiCiTest(): ...@@ -1328,7 +1328,7 @@ class OaiCiTest():
SSH = sshconnection.SSHConnection() SSH = sshconnection.SSHConnection()
SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword) SSH.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
if self.ADBCentralized: if self.ADBCentralized:
SSH.command('lsusb | egrep "Future Technology Devices International, Ltd FT2232C" | sed -e "s#:.*##" -e "s# #_#g"', '\$', 15) SSH.command('lsusb | egrep --colour=never "Future Technology Devices International, Ltd FT2232C" | sed -e "s#:.*##" -e "s# #_#g"', '\$', 15)
#self.CatMDevices = re.findall("\\\\r\\\\n([A-Za-z0-9_]+)",SSH.getBefore()) #self.CatMDevices = re.findall("\\\\r\\\\n([A-Za-z0-9_]+)",SSH.getBefore())
self.CatMDevices = re.findall("\\\\r\\\\n([A-Za-z0-9_]+)",SSH.getBefore()) self.CatMDevices = re.findall("\\\\r\\\\n([A-Za-z0-9_]+)",SSH.getBefore())
else: else:
......
...@@ -404,7 +404,7 @@ class EPCManagement(): ...@@ -404,7 +404,7 @@ class EPCManagement():
elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT oai_hss || true', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT oai_hss || true', '\$', 5)
time.sleep(2) time.sleep(2)
mySSH.command('stdbuf -o0 ps -aux | grep hss | grep -v grep', '\$', 5) mySSH.command('stdbuf -o0 ps -aux | grep --colour=never hss | grep -v grep', '\$', 5)
result = re.search('oai_hss -j', mySSH.getBefore()) result = re.search('oai_hss -j', mySSH.getBefore())
if result is not None: if result is not None:
mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL oai_hss || true', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL oai_hss || true', '\$', 5)
...@@ -412,7 +412,7 @@ class EPCManagement(): ...@@ -412,7 +412,7 @@ class EPCManagement():
elif re.match('OAI', self.Type, re.IGNORECASE): elif re.match('OAI', self.Type, re.IGNORECASE):
mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_hss oai_hss || true', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGINT run_hss oai_hss || true', '\$', 5)
time.sleep(2) time.sleep(2)
mySSH.command('stdbuf -o0 ps -aux | grep hss | grep -v grep', '\$', 5) mySSH.command('stdbuf -o0 ps -aux | grep --colour=never hss | grep -v grep', '\$', 5)
result = re.search('\/bin\/bash .\/run_', mySSH.getBefore()) result = re.search('\/bin\/bash .\/run_', mySSH.getBefore())
if result is not None: if result is not None:
mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL run_hss oai_hss || true', '\$', 5) mySSH.command('echo ' + self.Password + ' | sudo -S killall --signal SIGKILL run_hss oai_hss || true', '\$', 5)
...@@ -520,7 +520,7 @@ class EPCManagement(): ...@@ -520,7 +520,7 @@ class EPCManagement():
mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5) mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60) mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60)
time.sleep(2) time.sleep(2)
mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep "Tracking area update" ','\$', 30) mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30)
result = re.search('Tracking area update request', mySSH.getBefore()) result = re.search('Tracking area update request', mySSH.getBefore())
if result is not None: if result is not None:
message = 'UE requested ' + mySSH.getBefore().count('Tracking area update request') + 'Tracking area update request(s)' message = 'UE requested ' + mySSH.getBefore().count('Tracking area update request') + 'Tracking area update request(s)'
...@@ -719,7 +719,7 @@ class EPCManagement(): ...@@ -719,7 +719,7 @@ class EPCManagement():
mySSH.command('docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) mySSH.command('docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60)
else: else:
mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60) mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60)
mySSH.command('tshark -r mme_' + self.testCase_id + '.pcap | egrep "Tracking area update"', '\$', 60) mySSH.command('tshark -r mme_' + self.testCase_id + '.pcap | egrep --colour=never "Tracking area update"', '\$', 60)
result = re.search('Tracking area update request', mySSH.getBefore()) result = re.search('Tracking area update request', mySSH.getBefore())
if result is not None: if result is not None:
message = 'UE requested ' + mySSH.getBefore().count('Tracking area update request') + 'Tracking area update request(s)' message = 'UE requested ' + mySSH.getBefore().count('Tracking area update request') + 'Tracking area update request(s)'
......
...@@ -165,16 +165,16 @@ class RANManagement(): ...@@ -165,16 +165,16 @@ class RANManagement():
result = re.search('LAST_BUILD_INFO', mySSH.getBefore()) result = re.search('LAST_BUILD_INFO', mySSH.getBefore())
if result is not None: if result is not None:
mismatch = False mismatch = False
mySSH.command('grep SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2) mySSH.command('grep --colour=never SRC_COMMIT LAST_BUILD_INFO.txt', '\$', 2)
result = re.search(self.ranCommitID, mySSH.getBefore()) result = re.search(self.ranCommitID, mySSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
mySSH.command('grep MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) mySSH.command('grep --colour=never MERGED_W_TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if (self.ranAllowMerge): if (self.ranAllowMerge):
result = re.search('YES', mySSH.getBefore()) result = re.search('YES', mySSH.getBefore())
if result is None: if result is None:
mismatch = True mismatch = True
mySSH.command('grep TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2) mySSH.command('grep --colour=never TGT_BRANCH LAST_BUILD_INFO.txt', '\$', 2)
if self.ranTargetBranch == '': if self.ranTargetBranch == '':
result = re.search('develop', mySSH.getBefore()) result = re.search('develop', mySSH.getBefore())
else: else:
...@@ -446,7 +446,7 @@ class RANManagement(): ...@@ -446,7 +446,7 @@ class RANManagement():
else: else:
mySSH.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2); mySSH.command('sed -i -e \'s/FLEXRAN_ENABLED.*;/FLEXRAN_ENABLED = "no";/\' ' + ci_full_config_file, '\$', 2);
self.eNBmbmsEnables[int(self.eNB_instance)] = False self.eNBmbmsEnables[int(self.eNB_instance)] = False
mySSH.command('grep enable_enb_m2 ' + ci_full_config_file, '\$', 2); mySSH.command('grep --colour=never enable_enb_m2 ' + ci_full_config_file, '\$', 2);
result = re.search('yes', mySSH.getBefore()) result = re.search('yes', mySSH.getBefore())
if result is not None: if result is not None:
self.eNBmbmsEnables[int(self.eNB_instance)] = True self.eNBmbmsEnables[int(self.eNB_instance)] = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment