summaryrefslogtreecommitdiff
path: root/test/apiv2/01-basic.at
Commit message (Collapse)AuthorAge
* Bump version to v4.1.0-devPaul Holzinger2022-04-27
| | | | | | | | I think we forgot to bump the version in the main branch. It should be v4.1.0-dev now. Also set the min api version to 4.0.0 as on the podman 4.0 branch. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* APIv2 tests: fail on syntax/logic errorsEd Santiago2021-12-14
| | | | | | | | | | | | | | | | (i.e. not test failures, but actual programming bugs). We've had a number of syntax errors creep into this test, usually caused by a missing backslash on a test command. I've long wanted to 'set -e' but that causes other problems. This PR introduces error handling via 'trap', with useful diagnostics on failure. This PR also catches and fixes two previously-unknown bugs that were causing tests to not actually run. And, since /events takes eons on my high-uptime laptop, add /since Signed-off-by: Ed Santiago <santiago@redhat.com>
* Bump to v4.0.0-devMatthew Heon2021-08-02
| | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* APIv2 basic test: relax APIVersion checkEd Santiago2021-03-29
| | | | | | | | It is tedious and error-prone to update the 'APIVersion=<exact>' test every time there's a minor bump. Change the test so it confirms only the major version. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Bump to v3.2.0-devMatthew Heon2021-03-29
| | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* apiv2 tests: finally fix POST as originally intendedEd Santiago2021-03-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I originally wrote this code I had no idea what POST would look like so I did a sloppy job, deferring making it usable. Now that we have some real-world examples in place, I have a better understanding of what params look like and how to make tests more readable/maintainable. (Deferring isn't always bad: one of my early ideas was to separate params using commas; that would've been a disaster because some JSON values, such as arrays, include commas). This commit implements a better way of dealing with POST: * The main concept is still 'key=value' * When value is a JSON object (dictionary, array), it can be quoted. * Multiple params are simply separated by spaces. The 3-digit HTTP code is a prominent, readable separator between POST params and expected results. The parsing code is a little uglier, but test developers need never see that. The important thing is that writing tests is now easier. * POST params can be empty (this removes the need for a useless '') I snuck in one unrelated change: one of the newly-added tests, .NetworkSettings, was failing when run rootless (which is how I test on my setup). I made it conditional. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Use version package to track all versionsJhon Honce2021-03-03
| | | | | | | | | | | | * Server, bindings, and CLI all now pull version information from version package. * Current /libpod API version slaved to podman/libpod Version * Bindings validate against libpod API Minimal version * Remove pkg/bindings/bindings.go and updated tests Fixes: #9207 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Bump remote API version to 3.0.0Matthew Heon2021-02-04
| | | | | | Fixes #9175 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Tests: Fix common flakes, and improve apiv2 test logEd Santiago2020-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - apiv2 - the 'ten /info requests' test is flaking often, taking ~8 seconds (our limit is 7, up from 5 a few weeks ago). Brent suggested that the first /info call might be expensive, because it needs to access storage. So, let's prime it by running one /info outside the timing loop. And, because even that continues to fail, bump it up to 10 seconds and file #8076 to track the slowdown. - toolbox test - WaitForReady() has timed out, even on one occasion causing a run failure because it failed 3 times. Solution: bump up timeout from 2s to 5s. Not really great, but CI systems are underpowered, and it's not unreasonable that 2s might be too low. - sdnotify test - add a 'podman wait' between stop & rm. This may prevent a "cannot rm container as it is running" race condition. While working on this, Brent and I noticed a few ways that test-apiv2 logging can be improved: - test name: when request is POST, display the jsonified parameters, not the original input ones. This should make it much easier to reproduce failures. - use curl's "--write-out" option to capture http code, content type, and request time. We were getting the first two via grep from logged headers; this is cleaner. And there was no other way to get timing. We now include the timing as X-Response-Time in the log file. - abort on *any* curl error, not just 7 (cannot connect). Any error at all from curl is bad news. Signed-off-by: Ed Santiago <santiago@redhat.com>
* APIv2 tests: try again to fix themEd Santiago2020-10-12
| | | | | | | | | | | | | | | | CI discovered that a lot of networking tests are failing; my fault, for not having run my tests as root on my laptop. Disable those. Also: bump up the ten-request time limit, from 5 to 7 seconds. Looks like something keeps getting slower and slower, but I guess there's not much we can do about it. Also: when we get a mismatch response code (e.g. 500 when we expect 200), dump the response body and skip any subsequent response checks. Signed-off-by: Ed Santiago <santiago@redhat.com>
* Refactor API version valuesJhon Honce2020-09-15
| | | | | | | | | | | | | | | | * API-Version header now Major.Minor to support tools parsing this header * Libpod Version updated to 2.0.0 to reflect changes in API field values * API-Version and Libpod-API-Version headers are now included in all results Fixes #7327 * Header support tested against goland 2020.2 and https://www.jetbrains.com/help/idea/docker.html plugin Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Add versioned _ping endpointJhon Honce2020-07-31
| | | | | | Fixes #7008 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* test/apiv2: add a simple events testValentin Rothberg2020-07-27
| | | | | | | Add a simple test to exercise the events API without the "filters" parameter. Prevents regressing on #7078. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* V2 API Version SupportJhon Honce2020-05-20
| | | | | | | | | | | | | | | | | * Update blang/semver to allow ParseTolerant() support * Provide helper functions for API handlers to obtain client's 'version' path variable focused on API endpoint tree: libpod vs. compat * Introduce new errors: * version not given in path, endpoints may determine if this is a hard error (ErrVersionNotGiven) * given version not supported (ErrVersionNotSupported), only a soft error if the handler is going to hijack the connection * Added unit tests for version parsing * bindings check version on connect: * client <= Server API version connection is continued * client >= Server API version connection fails Signed-off-by: Jhon Honce <jhonce@redhat.com>
* CI: add API v2 testsEd Santiago2020-03-02
| | | | | | | | | | API v2 has been quiet for a few days, and the test script is actually passing. Let's take advantage of this opportunity to get them running in CI. Requires adding a check for cgroupsv2 Signed-off-by: Ed Santiago <santiago@redhat.com>
* apiv2 tests: add more pod tests, timing checkEd Santiago2020-02-25
| | | | | | | | | | | | | | | | Looks like /libpod/pods/create has been fixed to return an actual pod ID. Extend those tests. Also, update timeout in the server command: it's now seconds, not milliseconds. Also, update FIXME comments in /pods/prune . Still doesn't work, but clarify what we're seeing. Also, add a new test that runs ten /info requests and barfs if it takes more than 5 seconds. Signed-off-by: Ed Santiago <santiago@redhat.com>
* API v2 tests: catch up to moving targetEd Santiago2020-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots has changed since I first checked this in: * Switch to new podman system service invocation * /containers API has changed drastically * /pods API has some fixes; check for them (e.g. container-exists is now 409 Conflict, not 500) * One test ('?invalidparam=x') still doesn't work; comment it out so we can get everything passing. Also, some work on the test framework itself: * Cleaner port-open testing (the bash /dev/tcp check). * Add a 'podman' function to invoke local podman and log its output. The above two allow us to: * Get rid of stderr special-casing Furthermore: * t() no longer needs leading '.'; this allows jq features such as 'length' and perhaps other filters * special-case handling of 204 and 304: rfc2616 demands that they return no message body; assert that it is so. * new root & rootless helper functions (check server) * remove the "unlikely to work" message for rootless; it seems to be working fine * fix pod tests for rootless * BUT: add a bolder FIXME because the ID field seems wrong Signed-off-by: Ed Santiago <santiago@redhat.com>
* Tests for API v2Ed Santiago2020-01-17
Initial framework for testing the version 2 (HTTP) API. Includes a collection of tests for some of the existing endpoints. Not all tests are currently passing. Signed-off-by: Ed Santiago <santiago@redhat.com>