Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 29 additions & 5 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,27 @@ jobs:
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@v2

logind:
name: Logind/${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_MIN_SRV }}
- uses: Swatinem/rust-cache@v2
- name: Compare with systemd commands
shell: bash
run: |
cargo test --locked --no-default-features --features test_logind --test tests --no-run --message-format=json > "$RUNNER_TEMP/logind-tests.json"
logind_test_binary=$(jq -r 'select(.reason == "compiler-artifact" and .target.name == "tests" and .executable != null) | .executable' "$RUNNER_TEMP/logind-tests.json")
bash util/test-logind.sh "$logind_test_binary"

style_deps:
## ToDO: [2021-11-10; rivy] 'Style/deps' needs more informative output and better integration of results into the GHA dashboard
name: Style/deps
Expand Down Expand Up @@ -233,7 +254,7 @@ jobs:
cargo +stable fetch --locked --quiet --target $(rustc --print host-tuple)
cargo +stable tree --no-dedupe --locked -e=no-dev --prefix=none ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} | grep -vE "$PWD" | sort --unique
- name: Test
run: cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
run: cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} --features test_logind -p uucore -p coreutils
env:
RUSTFLAGS: "-Awarnings"
RUST_BACKTRACE: "1"
Expand Down Expand Up @@ -305,6 +326,9 @@ jobs:
run: cargo nextest run --hide-progress-bar --profile ci --features ${{ matrix.job.features }}
env:
RUST_BACKTRACE: "1"
- name: Test utmpx with systemd-logind
if: runner.os == 'Linux'
run: cargo test -p uucore -p uu_who -p uu_pinky --lib --locked --features systemd-logind
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v7
Expand Down Expand Up @@ -557,9 +581,9 @@ jobs:
esac
case '${{ matrix.job.os }}' in
ubuntu-*)
# selinux and systemd headers needed to build tests
# selinux headers needed to build tests
sudo apt-get -y update
sudo apt-get -y install libselinux1-dev libsystemd-dev
sudo apt-get -y install libselinux1-dev
# pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
# In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands, and "system boot" entry is missing.
# The account also has empty gecos fields.
Expand Down Expand Up @@ -796,10 +820,10 @@ jobs:
## Install/setup prerequisites
case '${{ matrix.job.os }}' in
ubuntu-latest)
# selinux and systemd headers needed to build tests
# selinux headers needed to build tests
# acl: setfacl for coverage profile-trace dir default ACL (umask 0777 tests)
sudo apt-get -y update
sudo apt-get -y install libselinux1-dev libsystemd-dev acl
sudo apt-get -y install libselinux1-dev acl
# pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
# In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands, and "system boot" entry is missing.
# The account also has empty gecos fields.
Expand Down
2 changes: 2 additions & 0 deletions .vscode/cspell.dictionaries/dependencies.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ textwrap
thiserror
walkdir
winapi
zbus
zerocopy
zruntime
6 changes: 6 additions & 0 deletions .vscode/cspell.dictionaries/workspace.wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# * cargo
cdylib
doctest
libloading
nocapture

# * uutils project
uutils
Expand All @@ -11,6 +13,8 @@ ucmd
uumain
rlimit
mkfifo
logind
dbus
urandom
uchild
ello
Expand Down Expand Up @@ -203,6 +207,8 @@ inode
inodes
isatty
lchown
libsystemd
ohos
pathlen
setgid
setgroups
Expand Down
153 changes: 153 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jiff = "0.2.18"
jiff-icu = "0.2.2"
jiff-tzdb = "0.1"
libc = "0.2.191"
libloading = "0.8.9"
lscolors = { version = "0.21.0", default-features = false, features = [
"gnu_legacy",
] }
Expand Down Expand Up @@ -438,6 +439,8 @@ openssl = [
]
# "test_risky_names" == enable tests that create problematic file names (would make a network share inaccessible to Windows, breaks SVN on Mac OS, etc.)
test_risky_names = []
# Linux logind integration tests.
test_logind = ["who", "pinky", "users", "uptime"]
# * only build `uudoc` when `--feature uudoc` is activated
uudoc = [
"dep:clap_complete",
Expand All @@ -461,14 +464,6 @@ feat_diagnostics = ["uucore/diagnostics"]
## Optional feature for stdbuf
# "feat_external_libstdbuf" == use an external libstdbuf.so for stdbuf instead of embedding it
feat_external_libstdbuf = ["stdbuf/feat_external_libstdbuf"]
# "feat_systemd_logind" == enable systemd_logind support for utmpx replacement
feat_systemd_logind = [
"pinky/systemd_logind",
"uptime/systemd_logind",
"users/systemd_logind",
"uucore/systemd_logind",
"who/systemd_logind",
]
# "feat_selinux" == enable support for SELinux Security Context (by using `--features feat_selinux`)
# NOTE:
# * The selinux(-sys) crate requires `libselinux` headers and shared library to be accessible in the C toolchain at compile time.
Expand Down
Loading
Loading