about summary refs log tree commit diff
path: root/nixos/lib/test-driver
AgeCommit message (Collapse)AuthorFilesLines
2024-06-14nixos/lib/test-driver: Prevent unnecessary rebuildsSilvan Mosberger1-2/+11
E.g. when only Nix files change
2024-06-06nixos/test-driver: fix return value of subtest functionMartin Weinelt1-1/+0
Mypy since version 1.10.0 complains about this: > test_driver/driver.py:109: error: No return value expected [return-value]
2024-05-23nixosTests.nixos-test-driver: fix ruff checkGaetan Lepage1-2/+1
2024-05-22nixos/test-driver: adjust to ruff changesDawid Dziurla2-3/+3
2024-05-07nixos/test-driver: rm global loggerStefan Hertrampf6-44/+64
We remove the global rootlog in favor of instantiating the logger as required in the __init__.py and pass it down as a parameter (of our AbstractLogger type).
2024-05-07nixos/test-driver: enable XML log selectivelyStefan Hertrampf1-6/+3
Previously, the XML logging was always present and only created an output file if a special environment variable was present. We now only create the XML logger if the environment variable is present, saving us from logging to XML internally if it is not required.
2024-05-07nixos/test-driver: add junit-xml loggerStefan Hertrampf2-3/+90
We add a new logger that allows generating a junit-xml compatible report listing the subtests used in the nixos integration test. Junit-xml is a widely used standard for test reports. The report can be used for quick evaluation of which subtest failed.
2024-05-07nixos/test-driver: Separate XML and Terminal logStefan Hertrampf1-23/+114
We use the newly AbstractLogger class and separate the XML and Terminal logging that is currently mixed into one class. We restore the old behavior by introducing a CompositeLogger that takes care of logging both to terminal and XML.
2024-05-07nixos/test-driver: add AbstractLogger interfaceStefan Hertrampf1-2/+39
2024-04-22nixos/test-driver: use function instead of varStefan Hertrampf2-2/+5
Use a proper function to enable serial log printing instead of setting class member variables directly.
2024-04-22nixos/test-driver: add junit-xml python packageStefan Hertrampf2-0/+5
2024-04-22nixos/test-driver: separate the subtest log callStefan Hertrampf2-1/+6
We do not use the generic "nested" function but introduce a separate subtest log call. This will later allow us to track subtests and account logs to specific subtests.
2024-04-05nixos/test-driver: don't add QEMU_OPTS twiceAlyssa Ross1-2/+0
As the TODO says, this is already included by the script. If adding a device, including this again here would result in either two devices being added, or, if they were explicitly named, an error due to reuse of the name.
2024-03-26nixos/tests: Remove unnecesary wait from initrdBackdoorWill Fancher1-1/+0
2024-03-08nixos/lib/test-driver: fix mypy errors after staging-next mergeK9001-7/+5
2024-03-01nixos/lib/test-driver: make the warning message more noticeableK9001-1/+6
2024-02-28nixos/lib/test-driver: provide legacy path for ↵K9001-1/+37
create_machine({"startCommand": "..."})
2024-02-27nixos/lib/test-driver: drop LegacyStartCommand, clean up create_machine APIK9002-103/+10
We can finally do this now that it's no longer used.
2024-02-27lib/test-driver: don't swallow qemu stderrK9001-1/+0
2024-02-23nixos/testDriver: remove pinned mypy python versionMichael Schneider1-1/+0
2024-01-26nixos/test-driver: blackK9001-2/+4
2024-01-26Merge pull request #262772 from RaitoBezarius/qemu-vm/wait-for-eventJacek Galowicz1-0/+24
nixos/lib/test-driver: add `wait_for_qmp_event`
2024-01-25nixos/lib/test-driver: add `wait_for_qmp_event`Raito Bezarius1-0/+24
Adds a function to wait for a new QMP event with a model filter so that you can expect specific type of events with specific payloads. e.g. a guest-reset-induced shutdown event.
2024-01-12nixos/lib/test-driver: add setuptools build depK9001-1/+5
2023-11-16nixos/lib/test-driver: make wait_for_unit ask for ActiveState onlySomeone Serge1-2/+30
This is a hotfix for https://github.com/NixOS/nixpkgs/issues/266690, where `systemctl show $unit` sometimes randomly leaves ActiveState out
2023-11-09systemd-stage-1: Enable backdoor in nixos testsWill Fancher1-0/+16
2023-10-29nixos/lib/test-driver: add driver-timeout as a passthru testRaito Bezarius1-0/+5
From now on, we will aim to ensure that the test driver gets tested by OfBorg using all our available tests. This commit adds the driver timeout test to the driver.
2023-10-29nixos/test-driver: provide a global timeoutRaito Bezarius2-0/+34
Since the debut of the test-driver, we didn't obtain a race timer with the test execution to ensure that tests doesn't run beyond a certain amount of time. This is particularly important when you are running into hanging tests which cannot be detected by current facilities (requires more pvpanic wiring up, QMP API stuff, etc.). Two easy examples: - Some QEMU tests may get stuck in some situation and run for more than 24 hours → we default to 1 hour max. - Some QEMU tests may panic in the wrong place, e.g. UEFI firmware or worse → end users can set a "reasonable" amount of time And then, we should let the retry logic retest them until they succeed and adjust their global timeouts. Of course, this does not help with the fact that the timeout may need to be a function of the actual busyness of the machine running the tests. This is only one step towards increased reliability.
2023-10-22Merge pull request #257535 from RaitoBezarius/vmstateJacek Galowicz2-1/+112
nixos/lib/test-driver: use QMP API to watch for VM state
2023-10-21nixos/lib/test-driver: wire up QMP clientRaito Bezarius2-1/+112
Now that we have a QMP client, we can wire it up in the test driver. For now, it is almost completely useless because of the need of a constant "event loop", especially for event listening. In the next commits, we will slowly enable more and more usecases.
2023-10-09nixos/nginx: Allow empty port for listen directiveCarl Dong1-0/+22
When listening on unix sockets, it doesn't make sense to specify a port for nginx's listen directive. Since nginx defaults to port 80 when the port isn't specified (but the address is), we can change the default for the option to null as well without changing any behaviour.
2023-09-30nixos/test-driver: whitelist variable names that don't follow pep8Jörg Thalheim1-4/+4
https://docs.astral.sh/ruff/rules/invalid-argument-name/
2023-09-30nixos/test-driver: name exception according to pep8Jörg Thalheim1-2/+2
see https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name/
2023-09-30nixos/test-driver: apply ruff fixes & suggestionsJörg Thalheim7-29/+29
2023-09-30nixos/test-driver: disable typecheck for dependencies where don't have typingJörg Thalheim2-0/+12
2023-09-30nixos/test-driver: add shell.nixJörg Thalheim1-0/+2
this useful for local development
2023-09-30nixos/test-driver: fix type errors in extract-docstringsJörg Thalheim1-17/+25
2023-09-30nixos/test-driver: convert to pyproject from setup.pyJörg Thalheim3-24/+45
This also makes configuration available if you just run those tools locally. Also use ruff instead of pylint because it's faster and more comprehensive.
2023-09-29nixos/lib/test-driver: reduce spam at boot hangsRaito Bezarius1-0/+3
Since 008f9f0cd419bd66e922239e2319fd2b1f347ad8 ("nixos/test-driver: actually use the backdoor message to wait for backdoor"), when boot is still computering, we can get a tons of empty strings in response to the shell. This is not really useful to print and waste the disk space for any CI system that logs them. We stop logging chunks whenever they are empty.
2023-09-22test-driver: revert stderr nullpipeMaciej Krüger1-1/+3
Removes 2>/dev/null which re-adds stderr output breaking execute
2023-09-21Merge pull request #192593 from jlesquembre/test-driverArtturi1-14/+18
2023-09-20nixos/tests: make wait_for timeouts configurableJosé Luis Lafuente1-14/+18
While working on #192270, I noticed that only some wait_for_* helper functions make the timeout configurable. I think we should be able to customize it in all cases
2023-09-18nixos/test-driver: do not break if the command writes to stderrMaciej Krüger1-3/+1
Capturing `stderr` as part of the return `output` could break existing tests.
2023-08-17Merge pull request #245879 from teto/test-driverJacek Galowicz1-1/+7
test-driver: add persistent history
2023-07-30nixos/test-driver: formatBobby Rong1-1/+3
There is a `black --check --diff ${src}/test_driver` check in nixos-test-driver's checkPhase so this format change will be needed.
2023-07-29nixos/test-driver: log what to do if backdoor service doesn't come onelineDavid Arnold1-0/+1
2023-07-29test-driver: add persistent historyMatthieu Coudron1-1/+7
across sessions of interactive testing
2023-07-24Merge pull request #241949 from R-VdP/nixos_test_busyboxJacek Galowicz1-1/+1
nixos/test-driver: use the short form argument to base64 for busybox compatibility.
2023-07-10integration test driver: Auto-generate integration test driver's machineJacek Galowicz3-10/+97
method documentation of nixos docs from python doc strings
2023-07-09integration test driver: Synchronize integration test driver's docstrings in ↵Jacek Galowicz1-34/+183
Machine class methods with nixos documentation