Files
KasmVNC/spec/vncserver_adv_benchmarking_spec.py

23 lines
1.4 KiB
Python

from mamba import description, context, it, fit, before, after
from expects import expect, equal, contain, match
from helper.spec_helper import run_cmd, clean_env, kill_xvnc
with description("Benchmarking"):
with before.each:
clean_env()
with after.each:
kill_xvnc()
with it("runs benchmarks"):
run_cmd("wget --no-check-certificate https://kasmweb-build-artifacts.s3.us-east-1.amazonaws.com/kasmvnc/static/127072-737747495_small.mp4 -O /tmp/video.mp4")
completed_process = run_cmd("Xvnc -interface 0.0.0.0 :1 -Benchmark /tmp/video.mp4 -VideoArea 100 -BenchmarkResults JpegBenchmark.xml")
expect(completed_process.returncode).to(equal(0))
run_cmd('''sed -i "s/KasmVNC/$(grep -E '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') $(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2 | tr -d '"')/g" JpegBenchmark.xml''')
run_cmd("sed -i 's/testcase name=\"/testcase name=\"JPEG: /g' JpegBenchmark.xml")
completed_process = run_cmd("Xvnc -interface 0.0.0.0 :1 -Benchmark /tmp/video.mp4 -VideoArea 100 -BenchmarkResults WebPBenchmark.xml")
expect(completed_process.returncode).to(equal(0))
run_cmd('''sed -i "s/KasmVNC/$(grep -E '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') $(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2 | tr -d '"')/g" WebPBenchmark.xml''')
run_cmd("sed -i 's/testcase name=\"/testcase name=\"WebP: /g' WebPBenchmark.xml")