1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

test: the installer library's shell tests run with the suite

conf/test_install_lib.sh tested conf/install-lib.sh, but no CI step or
test ran it. It moves to webvirtcloud/tests/sh/install_lib.test.sh, takes
the library's path as its argument, and test_install_lib runs it in bash,
as the JS tests run in node.
This commit is contained in:
catborise 2026-11-06 11:18:11 +03:00
parent a58bbb3b35
commit 8abfd13874
3 changed files with 24 additions and 4 deletions

View file

@ -0,0 +1,20 @@
"""The installer's functions (conf/install-lib.sh), tested in bash."""
import shutil
import subprocess
import unittest
from pathlib import Path
from django.conf import settings
BASE = Path(settings.BASE_DIR)
class InstallLibTestCase(unittest.TestCase):
@unittest.skipUnless(shutil.which("bash"), "bash is not installed")
def test_install_lib(self):
result = subprocess.run(
["bash", str(BASE / "webvirtcloud/tests/sh/install_lib.test.sh"), str(BASE / "conf/install-lib.sh")],
capture_output=True, text=True, timeout=120,
)
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)