test fix sla rui n itoid
This commit is contained in:
@@ -88,8 +88,9 @@ class Carbeat(Challenge):
|
||||
return False
|
||||
|
||||
|
||||
def register(self, proc, name, level, timeout=1.):
|
||||
self._read_until(proc, "> ", timeout=timeout)
|
||||
def register(self, proc, name, level, timeout=1., skip_initial_prompt=False):
|
||||
if not skip_initial_prompt:
|
||||
self._read_until(proc, "> ", timeout=timeout)
|
||||
self._send_line(proc, "1")
|
||||
self._read_until(proc, ": ", timeout=timeout)
|
||||
self._send_line(proc, name)
|
||||
@@ -135,7 +136,11 @@ class Carbeat(Challenge):
|
||||
proc = self._spawn()
|
||||
self.logger.info("[1] process spawned ✅")
|
||||
|
||||
self.register(proc, "karbit", 1337)
|
||||
# Wait for initial menu to appear with longer timeout
|
||||
self._read_until(proc, "> ", timeout=10.0)
|
||||
self.logger.info("[1.5] initial menu appeared ✅")
|
||||
|
||||
self.register(proc, "karbit", 1337, skip_initial_prompt=True)
|
||||
self.logger.info("[2] user registered ✅")
|
||||
|
||||
name = self.list_user(proc)
|
||||
|
||||
@@ -174,14 +174,15 @@ class Sheesh(Challenge):
|
||||
raise AssertionError("Program did not exit after option 4")
|
||||
self.logger.info("[ok] service exit on 4")
|
||||
|
||||
proc_alarm = self._spawn()
|
||||
self._read_until(proc_alarm, "zzz", timeout=190.0) # 180s + slack
|
||||
try:
|
||||
proc_alarm.wait(timeout=5.0)
|
||||
except subprocess.TimeoutExpired:
|
||||
proc_alarm.kill()
|
||||
raise AssertionError("Alarm fired but process did not exit")
|
||||
self.logger.info("[ok] alarm fired ('zzz') and process self-terminated")
|
||||
# Skip alarm test during SLA checks (takes 180+ seconds)
|
||||
# proc_alarm = self._spawn()
|
||||
# self._read_until(proc_alarm, "zzz", timeout=190.0) # 180s + slack
|
||||
# try:
|
||||
# proc_alarm.wait(timeout=5.0)
|
||||
# except subprocess.TimeoutExpired:
|
||||
# proc_alarm.kill()
|
||||
# raise AssertionError("Alarm fired but process did not exit")
|
||||
# self.logger.info("[ok] alarm fired ('zzz') and process self-terminated")
|
||||
|
||||
self.logger.info('Check passed for sheesh')
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user