Skip to content
Snippets Groups Projects
Walter Lozano's avatar
Walter Lozano authored
In commit 2e59623a a fix to the cursor use was introduced. However, the fix
tries to overcome the issue in a wrong way.

The problem is caused by the fact that the cursor is saved before running the
test and then it is used to check newer entries of a specific type (audit).
Since when journalctl is used with -t the cursor is first moved to the first
entry of the specific type the --after-cursor was changed for --cursor to
make the test pass.

However, a better approach would be to save the cursor also taking into
account the type of entry we are interested on, so later when we use it we
can safetly check entries with --after-crusor.

The only tricky case would be if there are no previous entries of the
specific case, which will lead to an empty cursor. So also handle that case.

Signed-off-by: default avatarWalter Lozano <walter.lozano@collabora.com>
b1b1ded8
History

Common files shared accross apertis tests.

Those files are shared through a git subtree which is included by all test projects.

Use common-subtree.sh add to add the subtree in a tests repository. For example:

# Retrieve the common-subtree.sh script, we use `git`, but could also use `wget`
$ git clone git@gitlab.apertis.org:tests/common

# Clone the test repository if needed
$ git clone git@gitlab.apertis.org:tests/iptables-basic
# Enter the test directory
$ cd iptables-basic

# In the test directory, add the common git subtree
$ ../common/common-subtree.sh add

# A new commit has been created, push the test with the subtree initialized 
$ git push origin

If a script is supposed to be in the common/ directory, it should be commited in the common repository, and then it can be pulled into the git subtree using the command:

$ ../common/common-subtree.sh pull