Commit Graph

21 Commits

Author SHA1 Message Date
Giuseppe Scrivano
9f29b24805 tests: add tests for compose+add files
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #253
Approved by: cgwalters
2016-04-27 20:21:12 +00:00
Colin Walters
ed7fc02b04 postprocess: Ensure we error out if selinux is enabled, but no policy found
I was tracking another regression where we seem to have lost
`/usr/etc` contents which manifested as `Labeling with... (null)`
which was clearly wrong.

Now this change actually impacts the test suite - we now (again IMO
correctly) error out if `selinux: true`.  The `no-selinux-tag` test
no longer makes sense, so delete it.

We do need more "real" tests that use selinux on and off.

Pull request: #243
Approved by: jlebon
2016-03-22 18:35:33 +00:00
Colin Walters
c4d2da5596 tests: Delete intermediate source RPM so it isn't in repodata
Currently the libhif logic for selecting packages to install might
choose source packages, which causes all sorts of problems in both
libhif and rpm-ostree which aren't prepared to "install" source RPMs.

Fix this by deleting the srpm, which means it won't end up in the
repodata, and we won't abort deep in the bowels of librpm.

Pull request: #245
Approved by: giuseppe
2016-03-22 16:04:32 +00:00
Colin Walters
a9a49e72cd build: Use git.mk, make git status clean
Having a clean `git status` is really important for not missing files
one wants to `git add`.
2016-03-10 14:36:44 -05:00
Jonathan Lebon
b129df69dc Makefile-tests.am: add helper testenv target
The 'testenv' target enters an environment in which a tmpdir is created
and the daemon is set up and started. This is useful for easy testing.

$ make -j4 && make install
$ make testenv
===== ENTERING TESTENV =====
$ # now we can easily test our new code
$ # we can even make use of helper funcs
$ source ../tests/libtest.sh
$ setup_os_repository archive-z2 syslinux
$ exit
===== EXITING TESTENV =====
2016-02-26 13:06:00 -05:00
Jonathan Lebon
1c81b7f56e test-ucontainer.sh: use test-repo in srcdir
Running `make check` would fail because test-ucontainer.sh uses
test-repo, which points directly to the installed_testdir, where it is
not installed yet.

We make another processed version of test-repo.repo.in which instead
points to the repo in the srcdir and make use of that in
test-ucontainer.sh.

There are probably other ways of solving this, but this is the one that
jumped out at me.
2016-02-23 17:53:46 -05:00
Colin Walters
58cf2c9403 tests: Add test coverage for rpm-ostree container 2016-02-22 14:27:46 -05:00
Colin Walters
06f5577770 tests: Use createrepo_c
It's what more components are standardizing on.
2016-02-22 14:27:46 -05:00
Jonathan Lebon
87423f5707 Makefile-tests.am: fix program typo in note
The note mentions ostree instead of rpm-ostree. Also reword double usage
of "use".
2015-09-11 10:25:38 -04:00
Colin Walters
7267c1ec05 tests: Import dbus-run-session
Unfortunately RHEL 7 has an older version of dbus, and I use it as a
workstation.  It's not a lot of code and only used for tests.  We can
make it build time conditional down the line or something.
2015-09-09 22:00:05 -04:00
Matthew Barnes
0326568a4a tests: Adapt to rpm-ostree daemon
No doubt better ways are possible but this is the least messy thing
I could come up on a deadline.
2015-09-09 22:00:05 -04:00
Colin Walters
7b45f13a62 Link lib/ against libpriv/, use it to share sack loading function
On the plus side, we share some code between the library and the
binary now.  On the downside, because `librpmostreepriv.la` is a
noinst library, its code text is duplicated between the shared library
and binary, at least until we either:

 - Have the binary solely use the public shared library (like ostree does)
 - Install `librpmostreepriv.so` to e.g. `/usr/lib64/rpm-ostree/librpmostreepriv.so`
   without the headers being public
2015-04-23 16:30:17 -04:00
Giuseppe Scrivano
ad30a790de Makefile-tests.am: clean generated files
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-22 11:41:03 +02:00
Giuseppe Scrivano
7d86f72c79 do not crash when no selinux tag is present
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-13 10:43:24 +02:00
Giuseppe Scrivano
27008e402a tests: Add test for compose
A local yum repository, which contains a dummy .rpm package adding
support for programs needed by the post-process phase, is created as
part of the test.

Since no libc is present, the empty.c program (which is a no-op)
directly invokes the interrupt 0x80 to exit.

The test works only on x86_64, it is skipped on other architectures.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-13 10:43:24 +02:00
Giuseppe Scrivano
b2c3e8a264 make check: add note to run installed tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-13 10:43:24 +02:00
Giuseppe Scrivano
3360b2a404 tests/test-basic.sh: run only as part of installed tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-04-13 09:59:32 +02:00
Colin Walters
a8a2049443 build: Split up src into app/ and libpriv/
We currently have an internal-only library, but the sources for it are
in the same dir as the app.  For future work on a public shared
library, we'll need a clearer source structure.

Start by just renaming the app files into `src/app/`, and the internal
private library into `src/libpriv/`, with the appropriate
`Makefile.am` changes.

Closes: https://github.com/projectatomic/rpm-ostree/pull/123
2015-04-08 16:17:06 -04:00
Colin Walters
fc1a4b05fa tests/jsonutil: New test
Adding some basic coverage of the json parsing.
2014-12-19 10:47:55 -05:00
Colin Walters
fee9f48409 tests: Enable glib-tap.mk
These files were taken from json-glib, around the era of this commit:

https://git.gnome.org/browse/json-glib/tree/build/autotools?id=2779d537492f1902d71cf648631238110b62b311

Unfortunately, this involved hacking it up a bit:
 - I couldn't easily use `nobase` for the data, so I deleted that.
   Test data goes in the installed-tests dir.
 - Delete duplicated predeclared variables; we're using nonrecursive
   make.
 - Ensure we run each test in its own tmpdir
2014-12-19 10:47:55 -05:00
Colin Walters
a32ac06ce9 Import some basic testing infrastructure from OSTree
This is using the
https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests model.

In order to run the tests, you will need to:
./configure --enable-installed-tests

Then:
gnome-desktop-testing-runner -p 0 rpm-ostree/
2014-09-29 16:25:36 -04:00