summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* discover/boot: Allow null boot commandJeremy Kerr2013-06-241-3/+3
| | | | | | If we're booting from a default option, we don't have a boot command. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Add timeout waitersJeremy Kerr2013-06-248-45/+159
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: Add default option parsingJeremy Kerr2013-06-241-1/+39
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: print default status of boot optionsJeremy Kerr2013-06-241-0/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* types: Add is_default to struct boot_optionJeremy Kerr2013-06-242-1/+12
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Fix make maintainer-cleanGeoff Levand2013-05-293-323/+4
| | | | | | Fixes to make maintainer-clean work properly. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Remove gawk specificsGeoff Levand2013-05-292-2/+2
| | | | | | | Remove the GNU awk specifics to allow the use of a standard awk program. Fixes build errors on older distros. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Send options to client in orderGeoff Levand2013-05-211-2/+2
| | | | | | | | Send the boot options to the client in the order discovered. This change is in follow up to inverting the order that the server saves the options internally. Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover/grub2: remove uuid log messageJeremy Kerr2013-05-211-1/+0
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/test: Add boot status messages to test clientJeremy Kerr2013-05-211-0/+12
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: implement global keysJeremy Kerr2013-05-211-0/+16
| | | | | | | Add process_global_keys to handle global key events. Using this, implement ctrl+l to refresh. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* ui/ncurses: move getch() out of process_key callbacksJeremy Kerr2013-05-215-127/+116
| | | | | | | | All process_key callbacks will want to query the key that was pressed, so do the getch() once in cui_process_key, and pass the result to the callback. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: Ensure waiters are consistent during waiter_pollJeremy Kerr2013-05-211-19/+43
| | | | | | | | | | | | | | | | We have a bug at the moment: if the waitset's->waiters array is updated duing waiter_poll() (eg, a client connection is closed, and the client's callback performs a waiter_remove()), then we may invoke callbacks for incorrect waiters. This change uses a consistent waiters array duing execution of waiter_poll, so that any pollfds returned from poll() will result in correct callback invocations. This assumes that a waiter will only ever remove *itself* from the waitset; otherwise, we may call a free()ed waiter. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/waiter: allocate waiters separately from set->waitersJeremy Kerr2013-05-211-13/+22
| | | | | | | | | | Since we reallocate set->waiters, we can't hand out pointers to within that array. Instead, this change allocates the 'struct waiter's separately from the set->waiters array. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: fix error handling from failed client writesJeremy Kerr2013-05-211-4/+9
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Fix accept() return value checkJeremy Kerr2013-05-211-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: destroy client if message read failedJeremy Kerr2013-05-211-4/+11
| | | | | | | When a client disconnects, the read from the client's fd will return EOF. We should destroy the client in this situation. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pb-console: use getty rather than execJeremy Kerr2013-05-201-31/+58
| | | | | | exec is a bit flaky for starting on consoles, so use getty instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* utils/pbconsole: Use here-document for usage textJeremy Kerr2013-05-201-6/+8
| | | | | | Allows for cleaner usage message in the source. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: cleanup parser allocations on exitJeremy Kerr2013-05-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | | We should talloc_free the parser list once we're done, enabling valgrind's leak check. Before: [jk@pablo parser]$ valgrind ./test-null ... ==9330== HEAP SUMMARY: ==9330== in use at exit: 288 bytes in 3 blocks ==9330== total heap usage: 11 allocs, 8 frees, 1,177 bytes allocated After: [jk@pablo parser]$ valgrind ./test-null ... ==9940== HEAP SUMMARY: ==9940== in use at exit: 0 bytes in 0 blocks ==9940== total heap usage: 11 allocs, 11 frees, 1,177 bytes allocated ==9940== ==9940== All heap blocks were freed -- no leaks are possible Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* util/pb-console: Packaging updatesGeoff Levand2013-05-193-3/+56
| | | | | | | In preparation for packaging add a man page, a help option, and some comments to the script. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Add check_not_present_resourceGeoff Levand2013-05-184-0/+23
| | | | | | | | | | | Add a new routine check_not_present_resource() to check that a resource is not present. This is typically used to check that an initrd entry has not been found. Also add any needed checks for no initrd to the existing tests. Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser: Use list to hold parsersGeoff Levand2013-05-172-33/+37
| | | | | | | Now that we dynamically add parsers, we can use a list to hold them. Also simplifies the test_run_parser() routine. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Add ubuntu grub testsGeoff Levand2013-05-173-0/+318
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Better message outputGeoff Levand2013-05-171-6/+7
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser/grub2: Add parse for linux16Geoff Levand2013-05-171-1/+2
| | | | | | Ubuntu uses the linux16 symbol in thier conf files for memory test entries. Signed-off-by: Geoff Levand <geoff@infradead.org>
* parser/grub2: Better menuentry parsingGeoff Levand2013-05-171-6/+1
| | | | | | Grub2 menuentry entry text can use double or single quotes. Signed-off-by: Geoff Levand <geoff@infradead.org>
* configure: Add check for libncursesGeoff Levand2013-05-161-1/+9
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/parser: Add grub2 multiple resolution testJeremy Kerr2013-05-162-0/+42
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/grub2: handle search commands to specify root filesystemsJeremy Kerr2013-05-162-9/+113
| | | | | | Add a resource type for grub, allowing us to parse search parameters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover/resource: Provide resolve_resource_against_deviceJeremy Kerr2013-05-162-6/+8
| | | | | | | | Any other implementation of resources will need to resolve againsst particular devices, so make resolve_devpath_against_device publically-accessible, and rename to not be devpath-specific. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: log cleanupJeremy Kerr2013-05-166-28/+26
| | | | | | | Remove some of the more noisy log messages, and add some information pertinent to device resolution events. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add yaboot test from a ppc64 RH8 machineJeremy Kerr2013-05-163-2/+48
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add f18 grub config testJeremy Kerr2013-05-163-1/+191
| | | | | | Add a real-world config file from a f18 ppc64 machine. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add simple GRUB2 parser testJeremy Kerr2013-05-162-0/+31
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add simple kboot testJeremy Kerr2013-05-162-0/+27
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add yaboot test for external devicesJeremy Kerr2013-05-162-1/+38
| | | | | | | Add a yaboot test to add boot options for an external device, then hotplug that device. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add simple yaboot testJeremy Kerr2013-05-162-2/+33
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add test device hotplug functionsJeremy Kerr2013-05-162-0/+37
| | | | | | | | Add a function, test_hotplug_device(), to simulate the addition of devices during tests. This should make it possible to observe boot options' resources changing from unresolved state to resolved. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add resource check helpersJeremy Kerr2013-05-162-0/+53
| | | | | | | Add check_resolved_local_resource and check_unresolved_resource to check the resources returned from parsers. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add check_name helperJeremy Kerr2013-05-162-0/+22
| | | | | | Simple function to check a boot_option's name. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add check_args helperJeremy Kerr2013-05-162-0/+28
| | | | | | Add a small helper to check boot option arguments. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Add check_boot_option_count helper & get_boot_optionJeremy Kerr2013-05-162-0/+58
| | | | | | | Add a helper function to check the expected boot option counts, and print the boot option details if the check fails. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Error on invalid parser nameJeremy Kerr2013-05-161-0/+5
| | | | | | | We should error-out if we didn't find a valid parser, so it doesn't look like we found no boot options. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Allow raw config data in test .c filesJeremy Kerr2013-05-163-1/+38
| | | | | | | | Add a little post-processing script (extract-config.awk) to allow us to put the config data directly into the test .c files, without having to quote the C string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/parser: Allow tests to provide pre-loaded config dataJeremy Kerr2013-05-162-0/+12
| | | | | | | Some tests may want to use an existing buffer as config data, so add test_read_config_data() to allow this. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test: Replace parser tests with empty frameworkJeremy Kerr2013-05-1630-782/+237
| | | | | | | | | | | | | | | | | This change is a major rework of the parser tests. Currently, the parser tests just run the parsers on each subdir of data/, but we don't actually check the results. Rather than just running parsers and expecting a certain fixed output, the new tests are arbitraty (short!) C programs. This allows us to set up the device configuration / discover context etc in whatever manner necessary, and check that the boot options that the parsers emit are correct. This change removes all of the old tests, and adds a new "null" test. Actual tests will be added in subsequent changes. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Make device handler a little more testableJeremy Kerr2013-05-151-280/+307
| | | | | | | | | | | This change moves some of the device-handler code into an #ifdef-ed section, so we can easily drop the stuff that's not required for testing. Although the change is quite large, most of it is moving entire functions around. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/url: Add pb_url_to_stringJeremy Kerr2013-05-152-5/+9
| | | | | | Add a function to unparse a URL, to make comparisons in tests easy. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Allow devices with no device_pathJeremy Kerr2013-05-151-1/+4
| | | | | | | | Devices that have been added via the user path may not have a device path. In this case, don't segfault in device_match_path, and break out of mount_device early. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud