Skip to content

Commit

Permalink
tree: import changes from testing-devel at ef7c4b9
Browse files Browse the repository at this point in the history
  • Loading branch information
coreosbot committed Mar 24, 2021
1 parent 5cee2f0 commit 5047ad1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
#!/bin/bash
set -euo pipefail

# see related comment block in transposefs.sh re. inspecting the config directly
ignition_cfg=/run/ignition.json
rootpath=/dev/disk/by-label/root

query_rootfs() {
local filter=$1
jq -re ".storage?.filesystems? // [] |
map(select(.label == \"root\" and .wipeFilesystem == true)) |
.[0] | $filter" "${ignition_cfg}"
}

# If the rootfs was reprovisioned, then the mountOptions from the Ignition
# config has priority.
if [ -d /run/ignition-ostree-transposefs/root ]; then
if query_rootfs 'has("mountOptions")' >/dev/null; then
query_rootfs '.mountOptions | join(",")'
exit 0
fi
fi

eval $(blkid -o export ${rootpath})
if [ "${TYPE}" == "xfs" ]; then
# We use prjquota on XFS by default to aid multi-tenant Kubernetes (and
Expand Down
5 changes: 3 additions & 2 deletions tests/kola/root-reprovision/filesystem-only/config.ign
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"ignition": {
"version": "3.0.0"
"version": "3.2.0"
},
"storage": {
"filesystems": [
{
"device": "/dev/disk/by-label/root",
"wipeFilesystem": true,
"format": "ext4",
"label": "root"
"label": "root",
"mountOptions": ["debug"]
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions tests/kola/root-reprovision/filesystem-only/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ fstype=$(findmnt -nvr / -o FSTYPE)
[[ $fstype == ext4 ]]
ok "source is ext4"

rootflags=$(findmnt /sysroot -no OPTIONS)
if ! grep debug <<< "${rootflags}"; then
fatal "missing debug in root mount flags: ${rootflags}"
fi
ok "root mounted with debug"

case "${AUTOPKGTEST_REBOOT_MARK:-}" in
"")
# check that the partition was grown
Expand Down

0 comments on commit 5047ad1

Please sign in to comment.