summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Makefile: Pass down the variable EFI_BUILDSylvain Gault2015-11-271-3/+3
| | | | | | | | This variable indicates whether or nor the files are compiled for EFI. The lack of it lead the Makefiles to forget to add some compilation options specific to EFI. Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
* cmenu: the order of entries in $(LIBMENU) is vitalMatt Fleming2013-07-293-2/+15
| | | | | | | | | | | | | | | | Unresolved symbols in an object file cannot be resolved from shared libraries that are listed earlier in $(LIBMENU). We need to put the shared libraries at the end of $(LIBMENU). commit 1408e6ca ("Add per-firmware object directory support") appears to have broken this rule, which resulted in hdt.c32 (among other modules) failing to load with, "Undef symbol FAIL: symbol console_ansi_raw" Add a simple regression test that loads hdt.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: unit test bios_boot_linux()Matt Fleming2013-07-265-0/+5
| | | | | | | | | | | | The constraints for allocating the kernel cmdline buffer under bios are pretty involved and filled with historic rules. Unit test the bios linux loader to ensure we never violate any of them, while at the same time making sure we actually find a usable chunk of memory. This commit is designed to test the changes in commit 77cadda8 ("load_linux: dynamically calculate the cmdline region"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: verify kernel cmdline parameterMatt Fleming2013-07-253-2/+14
| | | | | | | Add a new test that verifies the kernel cmdline arguments we setup in our config file are passed to the kernel correctly. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: unit tests for core/memMatt Fleming2013-07-241-0/+0
| | | | | | | | | | | | | | | | | | | We can exercise the memory subsystem through unit tests with a little bit of coaxing. We need to create a number of fake data objects in order to get it to build. This is less than ideal, but once we've got good test coverage and confidence in our tests we can begin refactoring. Had this unit test already been in place, commit 33c4ab1b ("mem: fix regression in recent memscan changes") would have never been required because buggy commit a1331f8d ("memscan: pass enum syslinux_memmap_types around") would have broke the unit test. Ordinarily, this unit test would have been part of the bugfix commit 33c4ab1b, but the bugfix needs to be backported to 5.xx on its own. test_mem_init_reserved() tests whether SMT_RESERVED regions are incorrectly added to the memory subsystems's freelist. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: make mmap_entry globally available to unit testsMatt Fleming2013-07-242-0/+17
| | | | | | | | | | There's a bunch of places that need to deal with mmap_entry entries when doing tests, so make the structure readily available. Since we're going to get a collection of header files that could be considered the "unit test infrastructure" we might as well create a new directory for them. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: Syslinux unit testsMatt Fleming2013-07-2311-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve our faith in the validity of the Syslinux code by writing unit tests where possible. These should be used in addition to the regression tests - unit tests are a means of doing very fine-grained testing of code, whereas the regression tests are end-to-end tests that exercise abstract functionality. Unit tests run on your development machine and above all else, their execution time should be kept to a minimum to encourage repeated runs of the unit testsuite. The Syslinux header hierarchy has been reconstructed under tests/unittest/include. This allows us to reuse header files where appropriate by simply creating a file with the same name and including the original, e.g. tests/unittest/include/com32.h: #include <../../../com32/include/com32.h> Places where we need to override definitions (so that the tests build in a dev environment) obviously won't include the original header file, but such scenarios should be kept to a minimum, since you're not really testing any Syslinux code that way. To execute the collection of unit tests type, make unittest Sample output might look like, Executing unit tests Running library unit tests... [+] zonelist passed [+] movebits passed [+] memscan passed Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* tests: Regression testsuiteMatt Fleming2013-07-2318-0/+400
A number of Syslinux releases have contained regressions when compared with previous versions. Now that the size of the derivative grid has exploded (PXELINUX, SYSLINUX,.... bios, efi32, efi64) we need to have some means of ensuring we don't introduce regressions so easily. Start building a suite of regression tests. Regression tests should test end-to-end functionality, e.g. loading a Linux kernel. If a test fails, that failure represents a regression in some behaviour, e.g. Syslinux behaves differently than it previously did. The idea is that when bugs are reported in Syslinux, we can create new tests that reproduce the buggy behaviour. Once a fix has been committed the new test should pass. From that point forward, the test provides a means of ensuring we never reintroduce that bug. The collection of tests illustrates the agreed upon behaviour of Syslinux. To execute the regression testsuite type, make regression Sample output might look like, Executing regression tests for SYSLINUX Running Linux kernel regression tests... [+] empty passed [+] kernelhello passed Running COM32 module regression tests... [+] chaindisk passed Executing regression tests for PXELINUX Running Linux kernel regression tests... [!] empty failed [+] kernelhello passed [+] pxetest passed Qemu is used to execute the regression tests in a virtual environment. Because it takes time to load Qemu, we can forgive the regression testsuite for not executing instantaneously. However, developers should keep in mind the idea of "failing fast" in their regression tests to minimize execution time - that is, if a test is going to fail, make it fail as quickly as possible to reduce the testrun time. It's possible to have derivative-specific tests, where the test only runs for a specific Syslinux boot loader. For an example see pxetest in tests/linux/Makefile. Currently the regression testsuite requires root privileges to execute and makes several calls to sudo(8). In future it would be nice to get rid of this requirement. Signed-off-by: Matt Fleming <matt.fleming@intel.com>