common/rc: add scratch shutdown support for overlayfs
authorChengguang Xu <cgxu519@icloud.com>
Fri, 15 Dec 2017 07:47:33 +0000 (15:47 +0800)
committerEryu Guan <eguan@redhat.com>
Sun, 24 Dec 2017 13:30:58 +0000 (21:30 +0800)
commit2b4eae7fd825ffe2a966b2b1d8a040dcb999edf7
tree5808928a25fdfa4bc6db8c7178d9154cdda48221
parentdb71085194be8e96d4d94156f4c88f47a747e395
common/rc: add scratch shutdown support for overlayfs

Enable shutdown tests on overlayfs. This requires configuring
overlayfs with TEST|SCRATCH_DEV pointing to block device, which act
as base fs of overlay. The legacy config (pointing TEST|SCRATCH_DEV
to existing directories) won't support shutdown.

Extend _require_scratch_shutdown() to deal with overlay by checking
shutdown support on $OVL_BASE_SCRATCH_MNT instead of $SCRATCH_MNT,
so we check shutdown support status against the underlying upper fs
of overlay.

Introduce new _scratch_shutdown() helper to do the actual shutdown
work and shutdown upper fs in the case of overlay. Also converting
existing bare 'src/godown' calls to use this helper to avoid false
failures when testing overlayfs.

generic/042 and generic/050 assume $SCRATCH_DEV to be a local
device, so add _require_local_device $SCRATCH_DEV rule.

[eguan: rewrite commit log]

Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
19 files changed:
common/rc
tests/generic/042
tests/generic/043
tests/generic/044
tests/generic/045
tests/generic/046
tests/generic/047
tests/generic/048
tests/generic/049
tests/generic/050
tests/generic/051
tests/generic/052
tests/generic/054
tests/generic/055
tests/generic/388
tests/generic/392
tests/generic/417
tests/generic/461
tests/generic/468