summaryrefslogtreecommitdiff
path: root/tests/libtest-core.sh
Commit message (Collapse)AuthorAgeFilesLines
* tests/kola: Move to tests/kolainstColin Walters2020-05-271-1/+1
| | | | | | Follow the precedent set in https://github.com/coreos/rpm-ostree/pull/2106 and rename the directory, to more clearly move away from the "uninstalled" test model. Prep for Rust-based tests.
* tests: Rework tests/installed → tests/kolaColin Walters2020-03-191-153/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we made an effort to use the [Fedora Standard Test Interface](https://docs.fedoraproject.org/en-US/ci/standard-test-interface/). This effort was not very successful; the primary thing that it really died on is Ansible just didn't support rebooting very well. I think that's since gotten better, but even then, Ansible wasn't the best thing for a test framework for us anyways. In the meantime Fedora CoreOS happened emphasizing Ignition and not "post-hoc reconciliation" models like Ansible over ssh. And, [coreos-assembler](https://github.com/coreos/coreos-assembler) happened too. Furthermore, we really need to test OSTree's interaction with Ignition as we've invented several special things there. Then most recently, I've been working on having cosa/kola support running externally defined tests: https://github.com/coreos/coreos-assembler/pull/1215 There's a lot of things to clean up after this but at least this works for me: ``` $ cd /srv/fcos $ cosa kola run -- --parallel 4 --output-dir tmp/kola -E ~/src/github/ostreedev/ostree/ 'ext.ostree.*' ``` NOTE: This *does not* drop ostree binaries into the target. See: https://github.com/coreos/coreos-assembler/pull/1252#issuecomment-600623315 This drops our dependency on Python in the installed tests, and also fixes a few bugs that came up. I disabled the `itest-bare-user-root.sh` one because it's entangled with the shell script infrastructure for the unit tests.
* tests/core: Really pick C.UTF-8 localeDan Nicholson2020-01-211-1/+1
| | | | | | | | | The case-ignoring regex `^(C|en_US)` will match any locale that starts with `c`. On my system this is `ca_AD.utf8`, which breaks the test suite. Instead, use a single regex that includes the joining `.` rather than 2 separate regexes. This also changes `head` to use the `-n` option, which has been preferred for at least 10 years in the coreutils version and is supported by busybox as well.
* tests/core: Assume C.UTF-8 if locale isn't foundAlex Kiernan2019-11-011-3/+9
| | | | | | | When building with musl there's no locale command, also its default locale is C.UTF-8, so just get C.UTF-8 if we can't find locale. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* tests/core: Fallback to en_US.UTF-8 localeAlex Kiernan2019-10-311-8/+4
| | | | | | | | A number of tests expect explicit left/right single quotes in their messages, which will never happen in the C locale. Change so we pick a likely UTF-8 locale, or fail if we can't find one. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
* tests: Fix locale detectionJan Tojnar2018-06-031-2/+2
| | | | | | | | | | | | When a locale with C.utf8 in its name (e.g. es_EC.utf8) was installed on a system, the C.utf8 locale was chosen, even when it was not available. This patch fixes the grep pattern to match whole lines returned by locale -a. See: #1592 Closes: #1611 Approved by: cgwalters
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* tests/libtest-core: support multiple literal checksJonathan Lebon2018-01-111-3/+6
| | | | | | | | | | `grep` supports checking multiple fixed strings separated by newlines, but it's mostly just easier to pass them as separate arguments, so let's support that. This is now at parity with the similar `assert_file_has_content`. Closes: #1409 Approved by: cgwalters
* tests: Fix LC_ALL for systems which use .utf8 suffixesPhilip Withnall2017-12-141-0/+2
| | | | | | | | | | | | | libtest-core.sh tries to clear the locale to a UTF-8 supporting C locale, either by setting it to C.UTF-8 (preferred) or just C. Some systems, like Fedora 26, use the locale name C.utf8, rather than C.UTF-8. Support that too. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1347 Approved by: cgwalters
* tests: Explicitly unset LANGUAGE after setting LC_ALLSimon McVittie2017-09-191-0/+2
| | | | | | | | | | | | | | As a GNU extension, LANGUAGE takes precedence over LC_ALL for gettext(3) whenever the locale is not C, causing tests that grep for specific English strings to fail when run in non-English locales. The upstream glibc proposal for C.UTF-8 would give C.UTF-8 the same special case as C here, but the implementation in Debian does not currently have this, so we have to unset LANGUAGE too. Signed-off-by: Simon McVittie <smcv@collabora.com> Closes: #1188 Approved by: jlebon
* tests/libtest-core.sh: Add a comment that this copy is canonicalColin Walters2017-08-021-3/+6
| | | | | | | Ref: https://github.com/projectatomic/bubblewrap/pull/203 Closes: #1047 Approved by: jlebon
* checkout: also chmod in the user checkout caseJonathan Lebon2017-06-021-0/+7
| | | | | | | | | | | | | | When falling back to copying, we previously would only chmod checked out files in the non-user-checkout mode. Fix this by always doing chmod. The file_mode was being prepared but never actually applied. Add a basic test in the archive-z2 --> usermode checkout case in which we're guaranteed to always fall back to copy mode. Closes: #633 Closes: #903 Approved by: cgwalters
* tests/libtest-core: Copy rpm-ostree changes, clean upColin Walters2017-05-191-20/+34
| | | | | | | | | | | I want to keep this a "pure copy-able" file into various projects like rpm-ostree, bwrap, and flatpak. Pull in changes from rpm-ostree to prep for that. While we have the patient open, dedup the code for file matching a bit. Closes: #877 Approved by: jlebon
* tests: Fix regex escaping in test-summary-view.shPhilip Withnall2017-05-081-0/+7
| | | | | | | | | | | | | | There were some regex special characters in the pattern strings, which I think were causing the test to fail on some Travis builds due to using an invalid regex. Fix that by matching using fixed strings instead. We don’t need regexes here. Use a new assert_file_has_content_literal to do that for us. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #838 Approved by: cgwalters
* tests: Factor out a libtest-core.shColin Walters2017-04-251-0/+111
This could be shared more easily with e.g. rpm-ostree, but what I'm currently working on is installed, privileged (potentially destructive, i.e. VM) tests that will source this separately from the current `libtest.sh`. That does work installed, but in practice is oriented around unit (uninstalled, unprivileged) tests. Closes: #807 Approved by: jlebon