Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port libkeyutils tests #34

Merged
merged 47 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
87d6cd2
tests: factor out creating an invalid keyring
mathstuf Jul 7, 2019
e55d2a0
tests: use test names as key descriptions
mathstuf Jul 7, 2019
58b940a
tests/add: add a test for treating a key as a keyring
mathstuf Jul 7, 2019
9891f15
tests/add: whitespace nit
mathstuf Jul 7, 2019
6a7de94
tests: move test keyring creation to tests/utils
mathstuf Jul 8, 2019
25820b0
tests: remove unnecessary cloning
mathstuf Jul 8, 2019
4156e62
tests: clean up test keyrings
mathstuf Jul 8, 2019
7d1c913
tests/add: migrate old test_add_key test
mathstuf Jul 8, 2019
19cb0f5
tests/clear: add tests for clearing keyrings
mathstuf Jul 7, 2019
ee811f0
tests/utils/kernel: add statics for the uid and gid
mathstuf Jul 8, 2019
a2a04fb
tests/utils: add a function to create an invalid key
mathstuf Jul 8, 2019
e33d00a
tests/describe: port description tests from libkeyutils
mathstuf Jul 8, 2019
c12e3c1
tests/utils/kernel: explicitly use the lazy_static macro
mathstuf Jul 24, 2019
b32d2e4
tests/session: add session-based tests
mathstuf Jul 24, 2019
d0b3225
tests/utils: refactor out waiting for key garbage collection
mathstuf Jul 26, 2019
bac112c
utils/kernel: add functions for extracting the kernel version
mathstuf Jul 26, 2019
396a24c
tests/invalidate: test key and keyring invalidation
mathstuf Jul 26, 2019
7112055
tests/update: port update tests from libkeyutils
mathstuf Jul 26, 2019
bd7b8af
tests/revoke: add key and keyring revokation tests
mathstuf Jul 26, 2019
192315c
tests/timeout: test setting timeouts on keys and keyrings
mathstuf Jul 29, 2019
d7c251a
tests/newring: add keyring creation tests
mathstuf Jul 29, 2019
9f59d83
tests/reading: add tests for reading keys and keyrings
mathstuf Jul 30, 2019
7588661
tests/add: remove unnecessary key unlinking
mathstuf Aug 2, 2019
5d697d4
tests/add: simplify the payload values a bit
mathstuf Aug 2, 2019
911f06f
tests/add: use a utility function to transform a keyring
mathstuf Aug 2, 2019
375d8c8
KeyManager: fix API to match kernel semantics
mathstuf Aug 2, 2019
30f0e53
tests/instantiate: add tests for key instantiation
mathstuf Aug 2, 2019
ba3637d
Keyring::read: guard against a key-as-keyring panic
mathstuf Aug 2, 2019
b283904
tests/reading: test reading keys and keyrings as each other
mathstuf Aug 2, 2019
317a16c
constants: fix a typo in the Permission docstring
mathstuf Aug 13, 2019
2e0c1b9
encrypted: add support for the `enc32` format
mathstuf Aug 13, 2019
8e054fc
tests/link: add tests for link behavior
mathstuf Aug 14, 2019
afa55af
tests/unlink: add tests for unlinking keyrings and keys
mathstuf Aug 14, 2019
fdbfb5a
Keyring: fix API for searching
mathstuf Aug 14, 2019
2c2c748
tests/search: test searching for keys and keyrings
mathstuf Aug 14, 2019
05b8ddb
tests/permitting: add tests for permission modification
mathstuf Aug 14, 2019
87003fa
api: fix request methods
mathstuf Aug 14, 2019
8a6eeb6
tests/add: expand on tests for adding keyrings
mathstuf Sep 30, 2019
bd5dcd7
api: fix the `request` API
mathstuf Sep 30, 2019
1a70ad2
tests: make a ScopedKeyring for handling cleanup automatically
mathstuf Oct 3, 2019
21f2f02
ci: run tests with a single thread
mathstuf Jan 10, 2020
7004edc
tests: disable session tests (for now)
mathstuf Jan 10, 2020
f39e205
ci: update to tarpaulin 0.10.0
mathstuf Jan 10, 2020
2f6daae
clippy: add safety sections to unsafe functions
mathstuf Jan 10, 2020
dbac0f0
ci: require 1.35.0 for Option::copied
mathstuf Jan 10, 2020
da585d1
tests/permitting: allow root not having chown permission too
mathstuf Jan 10, 2020
7728eda
ci: download a precompiled cargo-tarpaulin binary
mathstuf Jan 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .ci/tarpaulin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -e

readonly version="0.10.0"
readonly sha256sum="6843be8384bf14385b36a3118efc1ed2d25d531acb8df954cd3f93d44018b09e"
readonly filename="cargo-tarpaulin-$version-travis"
readonly tarball="$filename.tar.gz"

cd .ci

echo "$sha256sum $tarball" > tarpaulin.sha256sum
curl -OL "https://github.com/xd009642/tarpaulin/releases/download/$version/$tarball"
sha256sum --check tarpaulin.sha256sum
tar xf "$tarball"
12 changes: 6 additions & 6 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rustfmt_task:
linux_task:
matrix:
- container:
image: rust:1.34.0
image: rust:1.35.0
- container:
image: rust:latest
- allow_failures: true
Expand All @@ -31,7 +31,7 @@ linux_task:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
build_script: cargo build
test_script: cargo test
test_script: cargo test -- --test-threads 1
before_cache_script: rm -rf $CARGO_HOME/registry/index

minimal_version_task:
Expand All @@ -52,13 +52,13 @@ coverage_task:
CODECOV_TOKEN: ENCRYPTED[1e221ef78a37c960613ff80db7141f3158e3218031934395466f4720f450b7acfd74e587819435ce9be0b13fa1b68f1b]
keyutils_script: apt-get update && apt-get install libkeyutils-dev
tarpaulin_cache:
folder: $CARGO_HOME/bin
populate_script: cargo install --version 0.8.7 cargo-tarpaulin
fingerprint_script: cargo install --list
folder: .ci
populate_script: .ci/tarpaulin.sh
fingerprint_script: cat .ci/tarpaulin.sh
lockfile_script: cargo generate-lockfile
cargo_cache:
folder: $CARGO_HOME/registry
fingerprint_script: cat Cargo.lock
coverage_script: cargo tarpaulin --out Xml
coverage_script: PATH=$PATH:$PWD/.ci cargo tarpaulin --out Xml
upload_script: bash <(curl -s https://codecov.io/bash) -X gcov
before_cache_script: rm -rf $CARGO_HOME/registry/index
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ members = ["keyutils-raw"]
[dev-dependencies]
lazy_static = "1"
regex = "1"
serial_test = "*"
serial_test_derive = "*"
semver = "*"

[dependencies]
bitflags = "1.0.4"
Expand Down
8 changes: 4 additions & 4 deletions keyutils-raw/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern "C" {
ringid: KeyringSerial,
type_: *const libc::c_char,
description: *const libc::c_char,
destringid: KeyringSerial)
destringid: Option<KeyringSerial>)
-> libc::c_long;
pub fn keyctl_read(
id: KeyringSerial,
Expand All @@ -100,12 +100,12 @@ extern "C" {
id: KeyringSerial,
payload: *const libc::c_void,
plen: libc::size_t,
ringid: KeyringSerial)
ringid: Option<KeyringSerial>)
-> libc::c_long;
pub fn keyctl_negate(
id: KeyringSerial,
timeout: TimeoutSeconds,
ringid: KeyringSerial)
ringid: Option<KeyringSerial>)
-> libc::c_long;
pub fn keyctl_set_reqkey_keyring(
reqkey_defl: libc::c_int)
Expand All @@ -128,7 +128,7 @@ extern "C" {
id: KeyringSerial,
timeout: TimeoutSeconds,
error: libc::c_uint,
ringid: KeyringSerial)
ringid: Option<KeyringSerial>)
-> libc::c_long;
pub fn keyctl_invalidate(
id: KeyringSerial)
Expand Down
Loading