72 Commits

Author SHA1 Message Date
Dimitri John Ledkov 5774390b2d Refactor stage1/init to source most of options from manifest, rather than flavor/stampfile-based.
This refactor will make it easier to integrate lkvm support, and also
brings other benefits.

Specifically, with this refactor almost all functionality of stage1
init is flavor independent and can be fully controlled via a manifest
and uses as little hard coded paths as possible.

Thus, e.g. distribution packagers, can create package which will only
have rkt/stage1 provided binaries (gc, waiter, init, etc.) and specify
the rest of things in the manifest (path to nspawn, ld.so, LD LIBRARY
PATH, libfakesdbooted.so, etc). And create fully free-standing
stage1.aci by simply creating basic distribution chroot with
distro-native tools and supplying a matching/correct aci-manifest. By
fully free-standing, I mean similar to current coreos flavor, which is
completely independent of the host OS binaries & load paths and is
truly run everywhere.

Many of these refactors will be useful for future lkvm integration,
e.g. reusing ld.so load paths and similar.
2015-06-09 10:47:56 +01:00
Iago López Galeiras c3bb4600ba functional tests: capture output and print it on error 2015-06-08 12:03:58 +02:00
Alban Crequy 2fb807a14b Functional tests, semaphore: reorder the tests
Load balance the tests on the two VMs to have faster tests.
2015-06-04 18:18:16 +02:00
Alban Crequy 2824964937 stage1: add RKT_STAGE1_USR_FROM=usr-from-host 2015-06-04 16:33:45 +02:00
Iago López Galeiras fd37804b9f functional tests: add isolators to the base image
This commit adds memory and cpu isolators to test we don't break
anything. The next step is adding a functional test that actually checks
the isolators are respected.
2015-06-03 14:47:55 +02:00
Alban Crequy f063ec92c6 functional test: TestPidFile*: update to ppid 2015-06-03 12:58:10 +02:00
Alban Crequy e58e40bf34 Merge pull request #973 from endocode/alban/functests_pidfilerace
Functional test: TestPidFileAbortedStart (pid file race)
2015-06-02 12:19:59 +02:00
Alban Crequy cf18a5a1b7 Functional test: TestPidFileAbortedStart (pid file race)
This test should catch more regression in the fix
https://github.com/coreos/rkt/pull/826
2015-06-02 11:58:42 +02:00
Jonathan Boulle a0af55518d Merge pull request #966 from endocode/alban/functests_v220
functional tests: test v220
2015-06-01 11:58:51 -07:00
Alban Crequy e105d1b55c Functional test: new test to check the pid file race
This test should catch any regression in the fix https://github.com/coreos/rkt/pull/826
2015-06-01 12:54:08 +02:00
Alban Crequy 2482549795 functional tests: test v220
This is following-up the bump to v220
https://github.com/coreos/rkt/pull/952
2015-05-29 15:59:42 +02:00
Alban Crequy f1bc78d872 functional test: TestExitCode: fix test
Since commit 76ed159 ("functional tests: TestFailure: don't rely on
systemd debug logs"), TestExitCode didn't test anything and always
passed.

Fortunately, there was no regression bugs introduced in rkt. So no harm
done. But let's fix the test to catch potential future regression bugs.
2015-05-29 15:15:39 +02:00
Yifan Gu dfeb39febc tests: Add rkt_cat_manifest_test to exercise 'rkt image cat-manifest'. 2015-05-28 14:41:46 -07:00
Alban Crequy 76ed159048 functional tests: TestFailure: don't rely on systemd debug logs
Don't rely on systemd debug logs: this can change from one version to
another and this can be redirected to the journal.

Instead, use commands like "rkt list" and "rkt status" to find the
status of the pod. Moreover, this tests more rkt commands too.
2015-05-28 12:18:52 +02:00
Iago López Galeiras 100550cb3f functional tests: add missing systemd dependencies
Now that we start systemd-journald in stage1, we need libseccomp to test
a systemd built from the source.
2015-05-28 12:18:52 +02:00
Alban Crequy c8cc50caa9 functional tests: start rkt from a systemd service file 2015-05-27 23:38:32 +02:00
Alban Crequy 6d933c8cd5 tests: rkt-inspect.aci can print messages in loop
sudo rkt -insecure-skip-verify=true run -set-env=MESSAGE_LOOP=10 ./rkt-inspect.aci -- -print-msg=Hello
2015-05-27 23:36:29 +02:00
Simone Gotti 2c66843cc1 aci: extract tar in chroot
this introduces tar extraction inside a chroot. This is done spawning a
new process. Instead of creating a new executable (difficult to find,
package etc...) it adds the concept of a multicall process (like busybox).

Now a new multicall command "extracttar" is added.
tar.ExtractTar executes this new command passing a pipe to send the
filesMap and the tar contents to stdin.

The incomplete "insecure link" checks are removed from the the tar
functions.  Additionally these functions are now not exported and the
extraction directory is always the root directory.
2015-05-26 23:40:36 +02:00
Simone Gotti 98f6d43a54 rkt/rmimage: Apply reference check to the whole image.
By now only the treestore isn't removed if an image is referenced by
some pod.
This brings the need of a store gc to remove the rendered images in
the treestore when they aren't referenced anymore. This is difficult to
coordinate and is an extra work that can be avoided simply not removing
also the image from the store (store.RemoveACI) if the image is
referenced. IMHO it's also more consistent as the image doesn't
disappear from the `rkt images` output.
2015-05-26 21:35:06 +02:00
Simone Gotti 097e8175a4 tests: add rkt rmimage functional tests.
This tests should check that images are removed from the store only when
unreferenced by any pod.
2015-05-24 10:59:13 +02:00
Alban Crequy ec12c9fa37 functional tests: semaphore: update dependencies
Semaphore updated their platform on May 19th. The dependencies are
already installed.
2015-05-20 17:34:31 +02:00
Alban Crequy efe92216f1 functional tests: update string from systemd
Since systemd commit f2341e ("core,network: major per-object logging rework"),
systemd does not log "main process exited" but "Main process exited" (notice
the uppercase).

Improve the test to accept both strings.
2015-05-12 10:25:13 +02:00
Yifan Gu 320c25e036 rkt/tests: Print out the error info on failures.
This can help us to reason about the failures more easily.
2015-05-11 16:21:28 -07:00
Jonathan Boulle 9685f37575 *: adjust copyright header
Inspired by a similar change in the Kubernetes project [1], this changes
the copyright header to the more generic "The rkt Authors" rather than
"CoreOS, Inc.", which is only sometimes correct.

https://github.com/GoogleCloudPlatform/kubernetes/commit/6b3a6e6b983f967c88d14d26542ec6e30c49ebd3
2015-05-03 14:29:15 -07:00
Alban Crequy 068a233a95 functional tests: test multiple systemd
Use Semaphore's parallel build capability to test rkt against various
systemd versions.
2015-04-28 17:24:52 +02:00
Alban Crequy 751be11715 functional tests: add new systemd v219 dependencies 2015-04-28 17:24:52 +02:00
Alban Crequy cb8c6f5275 functional tests: environment: fix a race between child.Close() and ctx.reset()
Avoid child.Close(), prefer child.Wait()

Depending on the kernel version, it's not allowed to delete a directory
if it is a mount point, even in another mount namespace.
2015-04-28 16:28:17 +02:00
Alban Crequy 8c44d9a50c functional tests: better panic error messages
printing a string is more readable than printing a array of bytes
2015-04-28 16:28:10 +02:00
Krzesimir Nowak 638a8f0b82 functional tests: Fix gofmt and go vet issues 2015-04-28 12:14:50 +02:00
Krzesimir Nowak 4bded6e58b functional tests: Change $TMPDIR to ^TMPDIR^
This is to avoid confusion - $TMPDIR is replaced before the command is
ran. Also, it's more consistent - we use this format for RKT_BIN.
2015-04-28 11:29:29 +02:00
Krzesimir Nowak d302fdbf89 functional tests: Fix rkt run context use
Create just one context for the test and reset it after each
iteration, so unused directories are removed immediately instead of
during deferred cleanup.
2015-04-28 11:29:14 +02:00
Krzesimir Nowak f9a66a464f functional tests: Replace leftover "../bin/rkt" with rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak a4d595e719 functional tests: Use enumeration to specify config directory 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 25e2a39a28 functional tests: Drop dead code for destructive tests 2015-04-28 11:29:14 +02:00
Krzesimir Nowak eb458e526a functional tests: Port volume tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 3bc4b51880 functional tests: Port interactive tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 0a161531fd functional tests: Port capabilities tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak ec857f6ed4 functional tests: Port env tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 493b30d5b6 functional tests: Port exit tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 68bb9a923e functional tests: Port auth tests to rkt run context 2015-04-28 11:29:14 +02:00
Krzesimir Nowak 776aa80ba1 functional tests: Add rkt run context
This context manages rkt's data directory, local and system
configuration directories. They are by default placed somewhere in
/tmp dir. The context also provides basic rkt command to call, so rkt
uses those directories instead of default ones.

With this context tests do not have to be destructive - they can be
self-contained.
2015-04-28 11:29:14 +02:00
Alban Crequy 2ad1473030 functional tests: add a test for non-root apps 2015-04-24 10:47:58 +02:00
Alban ce8912295f Merge pull request #808 from endocode/alban/functests_deps
Semaphore: reduce dependencies for faster functional tests
2015-04-23 15:06:47 +02:00
Alban Crequy 3f1d704716 functional tests: use the correct version of go when using sudo
The functional tests use sudo because the tests need to be run as root.
Sudo does not preserve $PATH. When the user use a home-built go, it
might have a different version thatn the system-wide installed go.  It
causes problems when linking the tests with github.com/coreos/rkt/common

This patch fixes the issue by using the go environment of the user.
2015-04-23 12:33:56 +02:00
Alban Crequy 808e9f9166 Semaphore: reduce dependencies
The new Semaphore platform has most packages already installed.

Use awk instead of gawk in functional tests: awk is more commonly
installed than gawk.
2015-04-23 10:57:14 +02:00
Krzesimir Nowak 21ccdbd1cd *: Standardize on "system" and "local" configuration
So "vendor" config becomes "system" and "custom" one - "local".
2015-04-22 13:26:59 +02:00
Krzesimir Nowak 1ee0fbc6b3 rkt: Kill Default{Vendor,Custom}Path constants 2015-04-22 12:21:49 +02:00
Krzesimir Nowak b41508838f functional tests: Fix imports and formatting 2015-04-22 10:40:49 +02:00
Krzesimir Nowak 939006ff20 functional tests: Import test-aci-auth-server
It is now known as test-auth-server and it contains an aci
subpackage. Later we can add a docker package to test docker auth.
2015-04-22 10:40:49 +02:00
Krzesimir Nowak fe12a88642 functional tests: Address some more review issues 2015-04-22 10:40:49 +02:00