Commit Graph

3 Commits

Author SHA1 Message Date
Maya Rashish
5fede6938b
Make it possible to import images needing conversion from servers that don't support range requests (#1326)
* Combine tests in bad_webserver.go into a table

No functional change intended.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use a QCOW2 image for testing badserver.

This has the benefit of going through qemu-img for conversion,
which can introduce more bugs.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Don't pass URLs to qemu-img if Accept-Ranges header isn't bytes.

Adapt unit tests so they don't also test this feature.
Add a handler to bad-webserver to do a very plain HTTP response
using a downloaded file from cdi-file-host. This one doesn't
come with builtin support for range requests.

Use this handler to test that CDI can still import images needing
conversion.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Invert polarity and test for "none".

It's highly unlikely that a value other than bytes becomes a
valid choice, but let's not rule that out.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
2020-08-12 18:11:55 +02:00
Bartosz Rybacki
ec38c570ef
Correct check in badserver_tests (#1262)
* Correct check in badserver tests

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Extend wait timeout for data volume success on flaky server

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Do not use filesystem for state

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>

* Flaky server should only work on get.

Signed-off-by: Bartosz Rybacki <brybacki@redhat.com>
2020-07-06 17:11:37 +02:00
maya-r
93565b2c88
Implement local webserver to mimic flawed servers (for functional tests) (#1193)
* Implement local web server to mimic flawed servers

http://cdi-bad-webserver.cdi/flaky/filename will return a 503
"unavailable" error to most requests.

http://cdi-bad-webserver.cdi/forbidden-HEAD/filename will return
a 403 "Forbidden" error on HEAD requests.

In both those cases, we validate that we still eventually succeed
in creating a datavolume.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Add the imageio server to the manual test setup instructions.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Add missing bad-webserver.yaml.in (forgot to git add)

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Make "flaky" bad-webserver reproducibly flaky.

9 failures followed by a success.
Switch to port 9090, os-3.11 disallows using privileged ports,
and we don't have a reason to prefer port 80.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Provide polarion test IDs

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Make flaky test server fail less frequently.

The exponential backoff makes 10 retries very slow.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Tolerate being installed on a namespace that isn't "cdi"

Assume that we are in the same namespace as cdi-file-host, and
use that namespace in the URL.

Signed-off-by: Maya Rashish <mrashish@redhat.com>

* Use AfterEach to cleanup datavolumes after test.

Suggested by Alexander Wels.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
2020-05-08 00:01:19 +02:00