File: task.yaml

package info (click to toggle)
snapd 2.72-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,412 kB
  • sloc: sh: 16,506; ansic: 16,211; python: 11,213; makefile: 1,919; exp: 190; awk: 58; xml: 22
file content (24 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (3)
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