Skip to content

Commit

Permalink
Change StatusInfo to FrontendStatusInfo to prepare for individual nod…
Browse files Browse the repository at this point in the history
…e status tests
  • Loading branch information
sunetfreitag committed Jun 18, 2024
1 parent 2ebdf79 commit a66c897
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test_status_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
with open(expectedResultsFile, "r") as stream:
expectedResults=yaml.safe_load(stream)

class StatusInfo(threading.Thread):
class FrontendStatusInfo(threading.Thread):
def __init__(self, url, TestStatus):
threading.Thread.__init__(self)
self.url = url
Expand All @@ -41,7 +41,7 @@ def run(self):
global g_failedNodes
testThreadsRunning += 1
drv = sunetnextcloud.TestTarget()
logger.info(f'StatusInfo thread {testThreadsRunning} started for node {self.url}')
logger.info(f'FrontendStatusInfo thread {testThreadsRunning} started for node {self.url}')

try:
r =requests.get(self.url, timeout=g_requestTimeout)
Expand Down Expand Up @@ -69,7 +69,7 @@ def run(self):

logger.info(f'Status thread done for node {self.url}')
testThreadsRunning -= 1
logger.info(f'StatusInfo threads remaining: {testThreadsRunning}')
logger.info(f'FrontendStatusInfo threads remaining: {testThreadsRunning}')

class Status(threading.Thread):
def __init__(self, url, TestStatus):
Expand Down Expand Up @@ -123,7 +123,7 @@ def test_status_gss(self):
except Exception as error:
logger.error(f'An error occurred: {error}')

def test_statusinfo_gss(self):
def test_frontend_statusinfo_gss(self):
global logger
global expectedResults
logger.info(f'TestID: {self._testMethodName}')
Expand Down Expand Up @@ -163,19 +163,19 @@ def test_status(self):
self.assertTrue(False)


def test_statusinfo(self):
def test_frontend_statusinfo(self):
drv = sunetnextcloud.TestTarget()
for url in drv.get_allnode_status_urls():
with self.subTest(myurl=url):
logger.info(f'TestID: {url}')
statusInfoThread = StatusInfo(url, self)
statusInfoThread = FrontendStatusInfo(url, self)
statusInfoThread.start()

while(testThreadsRunning > 0):
time.sleep(1)

if len(g_failedNodes) > 0:
logger.error(f'StatusInfo test failed for {len(g_failedNodes)} of {len(drv.allnodes)} nodes:')
logger.error(f'FrontendStatusInfo test failed for {len(g_failedNodes)} of {len(drv.allnodes)} nodes:')
for node in g_failedNodes:
logger.error(f' {node}')
self.assertTrue(False)
Expand Down

0 comments on commit a66c897

Please sign in to comment.