Add binary recording test
This commit is contained in:
parent
ada0bacaed
commit
0e8f87a000
4 changed files with 48 additions and 21 deletions
|
|
@ -27,6 +27,7 @@ blocks:
|
||||||
- bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-session-recording*.noarch.rpm -s `pwd`/test/vm.install $TEST_OS
|
- bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-session-recording*.noarch.rpm -s `pwd`/test/vm.install $TEST_OS
|
||||||
- bots/image-customize -v -r "usermod -u 981 tlog || true" $TEST_OS
|
- bots/image-customize -v -r "usermod -u 981 tlog || true" $TEST_OS
|
||||||
- bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $TEST_OS
|
- bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $TEST_OS
|
||||||
|
- bots/image-customize -v -u ./test/files/binary-rec.journal:/var/log/journal/binary-rec.journal $TEST_OS
|
||||||
- test/check-application -v
|
- test/check-application -v
|
||||||
- name: Check centos-8
|
- name: Check centos-8
|
||||||
commands:
|
commands:
|
||||||
|
|
@ -34,6 +35,7 @@ blocks:
|
||||||
- bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-session-recording*.noarch.rpm -s `pwd`/test/vm.install $TEST_OS
|
- bots/image-customize -v -i cockpit-ws -i `pwd`/cockpit-session-recording*.noarch.rpm -s `pwd`/test/vm.install $TEST_OS
|
||||||
- bots/image-customize -v -r "usermod -u 981 tlog || true" $TEST_OS
|
- bots/image-customize -v -r "usermod -u 981 tlog || true" $TEST_OS
|
||||||
- bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $TEST_OS
|
- bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $TEST_OS
|
||||||
|
- bots/image-customize -v -u ./test/files/binary-rec.journal:/var/log/journal/binary-rec.journal $TEST_OS
|
||||||
- test/check-application -v
|
- test/check-application -v
|
||||||
epilogue:
|
epilogue:
|
||||||
on_fail:
|
on_fail:
|
||||||
|
|
|
||||||
1
Makefile
1
Makefile
|
|
@ -134,6 +134,7 @@ $(VM_IMAGE): $(RPMFILE) bots
|
||||||
bots/image-customize -v -i cockpit-ws -i `pwd`/$(RPMFILE) -s $(CURDIR)/test/vm.install $(TEST_OS)
|
bots/image-customize -v -i cockpit-ws -i `pwd`/$(RPMFILE) -s $(CURDIR)/test/vm.install $(TEST_OS)
|
||||||
bots/image-customize -v -r "usermod -u 981 tlog || true" $(TEST_OS)
|
bots/image-customize -v -r "usermod -u 981 tlog || true" $(TEST_OS)
|
||||||
bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $(TEST_OS)
|
bots/image-customize -v -u ./test/files/1.journal:/var/log/journal/1.journal $(TEST_OS)
|
||||||
|
bots/image-customize -v -u ./test/files/binary-rec.journal:/var/log/journal/binary-rec.journal $(TEST_OS)
|
||||||
|
|
||||||
# convenience target for the above
|
# convenience target for the above
|
||||||
vm: $(VM_IMAGE)
|
vm: $(VM_IMAGE)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import time
|
||||||
|
import json
|
||||||
|
import configparser
|
||||||
|
|
||||||
# import Cockpit's machinery for test VMs and its browser test API
|
# import Cockpit's machinery for test VMs and its browser test API
|
||||||
TEST_DIR = os.path.dirname(__file__)
|
TEST_DIR = os.path.dirname(__file__)
|
||||||
|
|
@ -21,12 +24,31 @@ class TestApplication(MachineCase):
|
||||||
b.wait_present("#app")
|
b.wait_present("#app")
|
||||||
return b, m
|
return b, m
|
||||||
|
|
||||||
def _sel_rec(self, index=0):
|
def _sel_rec(self, recording):
|
||||||
page = (
|
'''
|
||||||
"0f25700a28c44b599869745e5fda8b0c-7106-121e79"
|
rec1:
|
||||||
if not index
|
whoami
|
||||||
else "0f25700a28c44b599869745e5fda8b0c-7623-135541"
|
id
|
||||||
)
|
echo thisisatest123
|
||||||
|
sleep 16
|
||||||
|
echo thisisanothertest456
|
||||||
|
exit
|
||||||
|
|
||||||
|
rec2:
|
||||||
|
echo "Extra Commands"
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo ssh root@localhost
|
||||||
|
exit
|
||||||
|
|
||||||
|
binaryrec:
|
||||||
|
cat /usr/bin/gzip
|
||||||
|
'''
|
||||||
|
recordings = {'rec1': '0f25700a28c44b599869745e5fda8b0c-7106-121e79',
|
||||||
|
'rec2': '0f25700a28c44b599869745e5fda8b0c-7623-135541',
|
||||||
|
'binaryrec': '6c652ee938b3485894dbacbb8c7c2c61-5a4-38a5'}
|
||||||
|
|
||||||
|
page = recordings[recording]
|
||||||
|
|
||||||
self.browser.go(f"/session-recording#/{page}")
|
self.browser.go(f"/session-recording#/{page}")
|
||||||
|
|
||||||
def _term_line(self, lineno):
|
def _term_line(self, lineno):
|
||||||
|
|
@ -34,15 +56,23 @@ class TestApplication(MachineCase):
|
||||||
|
|
||||||
def testPlay(self):
|
def testPlay(self):
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
b.click("#player-play-pause")
|
b.click("#player-play-pause")
|
||||||
b.wait_in_text(self._term_line(1), "localhost")
|
b.wait_in_text(self._term_line(1), "localhost")
|
||||||
|
|
||||||
|
def testPlayBinary(self):
|
||||||
|
b, _ = self._login()
|
||||||
|
self._sel_rec('binaryrec')
|
||||||
|
b.click("#player-play-pause")
|
||||||
|
time.sleep(5)
|
||||||
|
b.wait_in_text(self._term_line(21), "<22>")
|
||||||
|
b.wait_in_text(self._term_line(25), "exit")
|
||||||
|
|
||||||
def testFastforwardControls(self):
|
def testFastforwardControls(self):
|
||||||
progress = ".pf-c-progress__indicator"
|
progress = ".pf-c-progress__indicator"
|
||||||
|
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# fast forward
|
# fast forward
|
||||||
b.click("#player-fast-forward")
|
b.click("#player-fast-forward")
|
||||||
b.wait_in_text(self._term_line(12), "exit")
|
b.wait_in_text(self._term_line(12), "exit")
|
||||||
|
|
@ -54,7 +84,7 @@ class TestApplication(MachineCase):
|
||||||
|
|
||||||
def testSpeedControls(self):
|
def testSpeedControls(self):
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# increase speed
|
# increase speed
|
||||||
b.wait_present("#player-speed-up")
|
b.wait_present("#player-speed-up")
|
||||||
b.click("#player-speed-up")
|
b.click("#player-speed-up")
|
||||||
|
|
@ -98,7 +128,7 @@ class TestApplication(MachineCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# Wait for terminal with scale(1)
|
# Wait for terminal with scale(1)
|
||||||
b.wait_present(default_scale_sel)
|
b.wait_present(default_scale_sel)
|
||||||
# Zoom in x3
|
# Zoom in x3
|
||||||
|
|
@ -117,7 +147,7 @@ class TestApplication(MachineCase):
|
||||||
|
|
||||||
def testSkipFrame(self):
|
def testSkipFrame(self):
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
b.wait_present(self._term_line(1))
|
b.wait_present(self._term_line(1))
|
||||||
# loop until 3 valid frames have passed
|
# loop until 3 valid frames have passed
|
||||||
while "localhost" not in b.text(self._term_line(1)):
|
while "localhost" not in b.text(self._term_line(1)):
|
||||||
|
|
@ -125,10 +155,8 @@ class TestApplication(MachineCase):
|
||||||
b.wait_in_text(self._term_line(1), "localhost")
|
b.wait_in_text(self._term_line(1), "localhost")
|
||||||
|
|
||||||
def testPlaybackPause(self):
|
def testPlaybackPause(self):
|
||||||
import time
|
|
||||||
|
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# Start and pause the player
|
# Start and pause the player
|
||||||
b.click("#player-restart")
|
b.click("#player-restart")
|
||||||
b.click("#player-play-pause")
|
b.click("#player-play-pause")
|
||||||
|
|
@ -140,8 +168,6 @@ class TestApplication(MachineCase):
|
||||||
b.click("#player-play-pause")
|
b.click("#player-play-pause")
|
||||||
|
|
||||||
def testSessionRecordingConf(self):
|
def testSessionRecordingConf(self):
|
||||||
import time, json, configparser
|
|
||||||
|
|
||||||
b, m = self._login()
|
b, m = self._login()
|
||||||
b.click("#btn-config")
|
b.click("#btn-config")
|
||||||
|
|
||||||
|
|
@ -240,7 +266,7 @@ class TestApplication(MachineCase):
|
||||||
|
|
||||||
def testDisplayDrag(self):
|
def testDisplayDrag(self):
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# start playback and pause in middle
|
# start playback and pause in middle
|
||||||
b.click("#player-play-pause")
|
b.click("#player-play-pause")
|
||||||
b.wait_in_text(self._term_line(1), "localhost")
|
b.wait_in_text(self._term_line(1), "localhost")
|
||||||
|
|
@ -259,7 +285,7 @@ class TestApplication(MachineCase):
|
||||||
def testLogCorrelation(self):
|
def testLogCorrelation(self):
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
# select the recording with the extra logs
|
# select the recording with the extra logs
|
||||||
self._sel_rec(1)
|
self._sel_rec('rec2')
|
||||||
b.click("#btn-logs-view .pf-c-expandable-section__toggle")
|
b.click("#btn-logs-view .pf-c-expandable-section__toggle")
|
||||||
# fast forward until the end
|
# fast forward until the end
|
||||||
while "exit" not in b.text(self._term_line(22)):
|
while "exit" not in b.text(self._term_line(22)):
|
||||||
|
|
@ -272,7 +298,7 @@ class TestApplication(MachineCase):
|
||||||
play_scale_sel = '.console-ct[style^="transform: scale(0.4"]'
|
play_scale_sel = '.console-ct[style^="transform: scale(0.4"]'
|
||||||
zoom_one_scale_sel = '.console-ct[style^="transform: scale(0.5"]'
|
zoom_one_scale_sel = '.console-ct[style^="transform: scale(0.5"]'
|
||||||
b, _ = self._login()
|
b, _ = self._login()
|
||||||
self._sel_rec()
|
self._sel_rec('rec1')
|
||||||
# set speed x16 and begin playing, expecting a size adjustment
|
# set speed x16 and begin playing, expecting a size adjustment
|
||||||
for _ in range(4):
|
for _ in range(4):
|
||||||
b.click("#player-speed-up")
|
b.click("#player-speed-up")
|
||||||
|
|
@ -289,8 +315,6 @@ class TestApplication(MachineCase):
|
||||||
b.wait_present(play_scale_sel)
|
b.wait_present(play_scale_sel)
|
||||||
|
|
||||||
def _filter(self, inp, occ_dict):
|
def _filter(self, inp, occ_dict):
|
||||||
import time
|
|
||||||
|
|
||||||
# ignore errors from half-entered timestamps due to searches occuring
|
# ignore errors from half-entered timestamps due to searches occuring
|
||||||
# before `set_input_text` is complete
|
# before `set_input_text` is complete
|
||||||
self.allow_journal_messages(".*timestamp.*")
|
self.allow_journal_messages(".*timestamp.*")
|
||||||
|
|
|
||||||
BIN
test/files/binary-rec.journal
Normal file
BIN
test/files/binary-rec.journal
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue