Commit Graph

30 Commits

Author SHA1 Message Date
Ayush Ranjan 23fcbd8722 [testing] Use container address to talk to server running inside container.
Docker does not have IPv6 port forwarding as tracked by the following issue:
https://github.com/moby/moby/issues/11518

So when running bazel itself inside a docker container, we can not use the host
port bindings to communicate with sockets inside the container. This was causing
integration tests and image tests to fail when run through our Makefile targets.

PiperOrigin-RevId: 332355051
2020-09-17 17:58:08 -07:00
Zeling Feng 86c1ae095a Add support to run packetimpact tests against Fuchsia
blaze test <test_name>_fuchsia_test will run the corresponding packetimpact
test against fuchsia.

PiperOrigin-RevId: 329835290
2020-09-02 19:19:40 -07:00
Fabricio Voznika 32e7a54f7f Make flag propagation automatic
Use reflection and tags to provide automatic conversion from
Config to flags. This makes adding new flags less error-prone,
skips flags using default values (easier to read), and makes
tests correctly use default flag values for test Configs.

Updates #3494

PiperOrigin-RevId: 328662070
2020-08-26 20:24:41 -07:00
Zach Koopmans 2b0b5e2521 Remove go profiling flag from dockerutil.
Go profiling was removed from runsc debug in a previous change.

PiperOrigin-RevId: 328203826
2020-08-24 13:53:10 -07:00
Bhasker Hariharan 710adf23cd Use a explicit random src for RandomID.
PiperOrigin-RevId: 327659759
2020-08-20 11:07:29 -07:00
Fabricio Voznika be76c7ce6e Move boot.Config to its own package
Updates #3494

PiperOrigin-RevId: 327548511
2020-08-19 18:37:42 -07:00
gVisor bot 3be8b49c70 Merge pull request #3375 from kevinGC:ipt-test-early-return
PiperOrigin-RevId: 326693922
2020-08-14 11:24:56 -07:00
Zach Koopmans 89f3197fc3 Mark integration tests as passing in VFS2 except CheckpointRestore.
Mark all tests passing for VFS2 in:
image_test
integration_test

There's no way to do negative look ahead/behind in golang test regex,
so check if the tests uses VFS2 and skip CheckPointRestore if it does.

PiperOrigin-RevId: 326050915
2020-08-11 10:37:32 -07:00
Kevin Krakauer 805a96d7ba Speed up iptables tests
//test/iptables:iptables_test runs 30 seconds faster on my machine.

* Using contexts instead of many smaller timeouts makes the tests less
  likely to flake and removes unnecessary complexity.
* We also use context to properly shut down concurrent goroutines and
  the test container.
* Container logs are always logged.
2020-08-10 17:50:01 -07:00
Zach Koopmans 7b9bfc0ce0 Port Ruby benchmark.
PiperOrigin-RevId: 325500772
2020-08-07 13:49:07 -07:00
Fabricio Voznika 190b1e6bd4 Stop profiling when the sentry exits
Also removes `--profile-goroutine` because it's equivalent
to `debug --stacks`.

PiperOrigin-RevId: 325061502
2020-08-05 11:30:11 -07:00
Kevin Krakauer bc8201d01b Have dockerutil.Wait* respect the context deadline
PiperOrigin-RevId: 324044634
2020-07-30 11:29:24 -07:00
Kevin Krakauer d9c9420335 ip6tables testing
We skip gVisor tests for now, as ip6tables aren't yet implemented.
2020-07-28 10:51:14 -07:00
Zach Koopmans 2ecf66903e Add profiling to dockerutil
Adds profiling with `runsc debug` or pprof to dockerutil. All
targets using dockerutil should now be able to use profiling.

In addition, modifies existing benchmarks to use profiling.

PiperOrigin-RevId: 323298634
2020-07-26 22:02:51 -07:00
Kevin Krakauer fb8be7e627 make connect(2) fail when dest is unreachable
Previously, ICMP destination unreachable datagrams were ignored by TCP
endpoints. This caused connect to hang when an intermediate router
couldn't find a route to the host.

This manifested as a Kokoro error when Docker IPv6 was enabled. The Ruby
image test would try to install the sinatra gem and hang indefinitely
attempting to use an IPv6 address.

Fixes #3079.
2020-07-22 16:51:42 -07:00
Adin Scannell e1a04f84e8 Add standard entrypoints for test targets.
PiperOrigin-RevId: 322265513
2020-07-20 18:05:05 -07:00
gVisor bot c81ac8ec3b Merge pull request #2672 from amscanne:shim-integrated
PiperOrigin-RevId: 321053634
2020-07-13 16:10:58 -07:00
Zach Koopmans b8d3d09bd1 Initial golang Benchmarks
PiperOrigin-RevId: 321021071
2020-07-13 13:29:30 -07:00
Adin Scannell 2afff44403 Update shim to build using bazel.
The go.mod dependency tree for the shim was somehow contradictory. After
resolving these issues (e.g. explicitly imported k8s 1.14, pulling a
specific dbus version), and adding all dependencies, the shim can now be
build as part of the regular bazel tree.

As part of this process, minor cleanup was done in all the source files:
headers were standardized (and include "The gVisor Authors" in addition
to the "The containerd Authors" if originally derived from containerd
sources), and comments were cleaned up to meet coding standards.

This change makes the containerd installation dynamic, so that multiple
versions can be tested, and drops the static installer for the VM image
itself.

This change also updates test/root/crictl_test.go and related utilities,
so that the containerd tests can be run on any version (and in cases
where it applies, they can be run on both v1 and v2 as parameterized
tests).
2020-07-09 17:39:47 -07:00
Zach Koopmans f3fa43cf23 Move all tests to new docker API.
Moves following to new dockerutil API:
- //test/e2e:integration_test
- //test/image:image_test
- //test/iptables:iptables_test
- //test/root:root_test
- //test/packetimpact:packetimpact_test

PiperOrigin-RevId: 320253118
2020-07-08 13:26:23 -07:00
Ayush Ranjan e3db9bda60 Enable shards in runtime test runner.
Fixed an issue with the runtime test runner which enables us to run tests in
shards. We had to touch the status file as indicated by an env var.

PiperOrigin-RevId: 320236205
2020-07-08 12:05:04 -07:00
Fabricio Voznika 97f6b20e89 Move mount configutation to RunOpts
Separate mount configuration from links and move it to
RunOpts, like the other options.

PiperOrigin-RevId: 317010158
2020-06-17 18:43:26 -07:00
Ian Lewis 8ea99d58ff Set the HOME environment variable for sub-containers.
Fixes #701

PiperOrigin-RevId: 316025635
2020-06-11 19:31:24 -07:00
gVisor bot 92bafd7929 Automated rollback of changelist 311424257
PiperOrigin-RevId: 313300554
2020-05-26 17:40:57 -07:00
Fabricio Voznika cdf48e8516 Fix TestTmpFile
Split check for file in /tmp from working directory test.
Fix readonly case which should not fail to create working
dir.

PiperOrigin-RevId: 312702930
2020-05-21 11:08:10 -07:00
Bhasker Hariharan 8605c97136 Automated rollback of changelist 311285868
PiperOrigin-RevId: 311424257
2020-05-13 16:13:37 -07:00
Ian Gudger e4058c0355 Replace test_runner.sh bash script with Go.
PiperOrigin-RevId: 311285868
2020-05-13 01:22:42 -07:00
Eyal Soha c9199bab92 More descriptive error message for missing docker image.
Tested:
  Ran a packetimpact test after `docker image rm` and examined the message.
PiperOrigin-RevId: 308370603
2020-04-24 20:00:24 -07:00
Adin Scannell c60613475c Standardize all Docker images.
This change moves all Docker images to a standard location, and abstracts the
build process so that they can be maintained in an automated fashion. This also
allows the images to be architecture-independent.

All images will now be referred to by the test framework via the canonical
`gvisor.dev/images/<name>`, where `<name>` is a function of the path within the
source tree.

In a subsequent change, continuous integration will be added so that the images
will always be correct and available locally.

In the end, using `bazel` for Docker containers is simply not possible. Given
that we already have the need to use `make` with the base container (for
Docker), we extend this approach to get more flexibility.

This change also adds a self-documenting and powerful Makefile that is intended
to replace the collection of scripts in scripts. Canonical (self-documenting)
targets can be added here for targets that understand which images need to be
loaded and/or built.

PiperOrigin-RevId: 308322438
2020-04-24 14:11:42 -07:00
Adin Scannell 1481499fe2 Simplify Docker test infrastructure.
This change adds a layer of abstraction around the internal Docker APIs,
and eliminates all direct dependencies on Dockerfiles in the infrastructure.

A subsequent change will automated the generation of local images (with
efficient caching). Note that this change drops the use of bazel container
rules, as that experiment does not seem to be viable.

PiperOrigin-RevId: 308095430
2020-04-23 11:33:30 -07:00