1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
summary: test chattr
details: |
Verify that through github.com/snapcore/snapd/osutil it is possible
to change file attributes. For that a toggle binary is compiled and
used to change the immutability attributes of a file.
# ubuntu-core doesn't have go :-)
# ppc64el disabled because of https://github.com/snapcore/snapd/issues/2503
systems: [-ubuntu-core-*, -ubuntu-*-ppc64el]
prepare: |
go build -o toggle ./toggle.go
execute: |
touch foo
# no immutable flag:
lsattr foo | NOMATCH i
test "$(./toggle foo)" = "mutable -> immutable"
# and now an immutable flag!:
lsattr foo | MATCH i
test "$(./toggle foo)" = "immutable -> mutable"
# no immutable flag again:
lsattr foo | NOMATCH i
|