summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Makefiles: remove -I$(includedir)Jeremy Kerr2013-05-073-3/+0
| | | | | | | | | | | Currently, we include the system include dir in some of our makefiles; this is causing build problems when cross-compiling, as the system include dir may not contain files for the host. The compiler should be searing in the proper system include dir, so just remove the redundant -I. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/url: fix no-scheme URL parsingJeremy Kerr2013-05-062-1/+9
| | | | | | | | | | | | | | | | | | | | | | | We were incorrectly dropping the first strlen("file://") characters from URLs with no scheme: --- test/urls/data/localpath.test 2013-05-02 17:26:48.826359036 +0800 +++ /tmp/tmp.gn4JsWLw5o 2013-05-02 17:26:50.262364613 +0800 @@ -2,6 +2,6 @@ scheme file host (null) port (null) -path /test/path/to/local/file -dir /test/path/to/local/ +path ath/to/local/file +dir ath/to/local/ file file This change fixes the issue by indicating "no scheme found" by a NULL return from pb_url_find_scheme, and hadling it appropriately. We add a testcase too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/url: Add uncommitted data filesJeremy Kerr2013-05-063-0/+21
| | | | | | | Add a couple of data files for test that'd I'd ommitted from an earlier commit. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Add empty list testJeremy Kerr2013-05-031-1/+17
| | | | | | | Check that the list iterators work on empty lists too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Add configuration methodsJeremy Kerr2013-04-291-1/+1
| | | | | | | | | | | | We'd like to be able to download petitboot configurations from other sources (not just local files), but we'll need some way to indicate to the parsers that a chunk of config data is from a specific source. This change adds "configuration methods". At present, we have only one: CONF_METHOD_LOCAL_FILE. For any incoming configuration data, we only run parsers that have registered themselves with that configuration method. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parsers: dynamically register parsersJeremy Kerr2013-04-291-1/+1
| | | | | | | | | | | | | | | Currently, we require all parsers to be defined in an array in parsers.c. This change removes this requirement, by introducting a register_parser() macro, which adds a constructor to register the parser with the core parser infrastructure. Because each parser no longer resolves an undefined symbol, we need to use a `ld -r` object for libparser, instead of using libtool, which creates a .a (and hence has no parsers included). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Change parsers to emit resources rather than filenamesJeremy Kerr2013-04-291-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | This change switches the parsers over to populate the resources in discover_boot_option, rather than the string parameters in boot_option. To do this, we need a few things: * Add struct resources to discover_boot_option for the boot_image, initrd and icon data. * Have the parsers populate the resources, rather than the strings. Currently, parsers can all use the devpath resource type. * Add a resolve_resource callback to parsers; this is how the device handler will attempt to resolve resources. * Change load_file to load_url, as we should be only accessing (resolved) resources by URLs. This then allows us to remove the mount map, and associated lookup code, as well as the UUID and label links to devices. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* discover: Introduce a container type for boot optionsJeremy Kerr2013-04-291-8/+23
| | | | | | | | | This change introduces a new type, struct discover_boot_option. Like struct discover_device adds discover-specific data to struct device, struct discover_boot_option allows the discover server to store more than just the boot option strings for a boot option. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/url: Add pb_join_urlJeremy Kerr2013-04-292-4/+15
| | | | | | Add a a function to join a string to a base URL Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Hook into `make check`Jeremy Kerr2013-04-292-2/+3
| | | | | | | This change hooks the new list tests into 'make check'. To do this, we need to fix the return code of the list-test program. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test: Rename test/list to test/libGeoff Levand2013-04-283-1/+1
| | | | | | | Having a test/list directory is a little too specific, so rename the test/list directory to test/lib as a place for any lib tests. Signed-off-by: Geoff Levand <geoff@infradead.org>
* test: Add list testGeoff Levand2013-04-233-1/+102
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* discover: Separate temporary and permanent device dataJeremy Kerr2013-04-161-5/+12
| | | | | | | | | | | At present, we keep both permanent (eg links/n_links) and temporary (event) data in struct discover_context. This change makes discover_context a temporary structure, just used during actual device discovery. Once discovery is complete, the permanent data (discover_device) is "committed" to the device handler. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/url: Move URL-handling code to libJeremy Kerr2013-04-152-5/+2
| | | | | | | We'll need to use the URL handling code in the server, so move it to the lib/ directory. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/urls: Fix distcheck breakagesJeremy Kerr2013-04-101-0/+4
| | | | | | | | We need a couple of extra automake variables to get `make distcheck` working. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* lib/types: Create common file for type definitionsJeremy Kerr2013-04-101-1/+1
| | | | | | | | | | | | The device and boot_option types are defined in pb-protocol.h, but aren't really specific to the procotol. This means a lot of non-messaging-related files are #including the protocol definitions unnecessarily. This change separates the types out into lib/types/types.h. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/url: Add http-simple.testJeremy Kerr2013-03-061-0/+7
| | | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* test: Add URL parser test infrastructureJeremy Kerr2013-03-065-1/+122
| | | | | | | | | | | | This change adds some simple testing infrastrcture to the URL parser. We use a small C binary (parse-url) to run the url parser on its argument, and compare the output with an expected datafile. An initial test is included, to check the behaviour of URLs with multiple slashes between host and pathname. This test currently fails. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add missing EXTRA_DIST filesGeoff Levand2012-03-292-1/+3
|
* Add grub.cfg from opensuse installGeoff Levand2012-03-262-0/+36
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add grub2 conf file parserGeoff Levand2012-03-182-0/+301
| | | | | | | | Add grub2 parser and sample config file. Reorder parser priorities: From (yaboot -> kboot) to (kboot -> grub2 -> yaboot). Signed-off-by: Geoff Levand <geoff@infradead.org>
* Parser test cleanupGeoff Levand2012-03-1826-44/+97
| | | | | | | | | | | Major cleanup of parser tests. * Change test data directory layout to ease test automation. * Remove some unneeded files. * Re-write test wraper script, rename to run-parser-tests. * Rework for autotools. Signed-off-by: Geoff Levand <geoff@infradead.org>
* Convert test to automakeGeoff Levand2012-03-161-0/+35
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Fix build error in parser-testGeoff Levand2012-03-161-2/+1
| | | | Signed-off-by: Geoff Levand <geoff@infradead.org>
* Add test case for empty yaboot.conf fileGeoff Levand2009-06-301-0/+6
| | | | | | | Add a test case for empty yaboot.conf files. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Kboot parser URL testGeoff Levand2009-03-301-0/+7
| | | | | | | Add a kboot parser test for network URLs. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add more yaboot parser testsGeoff Levand2009-03-304-0/+84
| | | | | | | | Add yaboot.conf files from fedora, OpenSUSE, and a yaboot whitespace and comment test. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fixup parser test programGeoff Levand2009-03-302-68/+57
| | | | | | | | | | Fixup the parser test program and helper script to work with the new multi-ui design. The expected-output files have not been updated. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add hotplug test scriptJeremy Kerr2009-03-231-0/+61
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Initial support for multiple UIsJeremy Kerr2008-12-1517-0/+277
Move the device discovery code from separate udev helpers to a single process to listen on two sockets: one SOCK_DGRAM for incoming udev events, and one SOCK_STREAM for UIs to connect. Initial support for client/server infrastructure, still need to wire-up the udev messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
OpenPOWER on IntegriCloud