Merge ~dbungert/curtin:fs_pass_one into curtin:master

Proposed by Dan Bungert
Status: Merged
Approved by: Dan Bungert
Approved revision: b24d7c09beeba0af3e00f9f8947c1f68183e23a2
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~dbungert/curtin:fs_pass_one
Merge into: curtin:master
Diff against target: 362 lines (+113/-22)
8 files modified
curtin/__init__.py (+2/-0)
curtin/block/schemas.py (+4/-0)
curtin/commands/block_meta.py (+29/-3)
doc/topics/storage.rst (+14/-1)
examples/tests/filesystem_battery.yaml (+4/-0)
tests/unittests/test_commands_block_meta.py (+54/-15)
tests/unittests/test_feature.py (+3/-0)
tests/vmtests/test_fs_battery.py (+3/-3)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Michael Hudson-Doyle Approve
Ryan Harper Pending
Review via email: mp+400005@code.launchpad.net

This proposal supersedes a proposal from 2021-03-17.

Commit message

Use /proc/filesystems to decide passno

The 'nodev' is intended to indicate
"whether the file system is mounted on a block device"
https://red.ht/3toGT5b

Use this info to set nodev items to passno 0, and default to 1 for
non-nodev or if the filesystem isn't present there.
Except that /proc/filesystems doesn't list 'swap' or 'none', so special
case those to passno 0.

LP: #1717584, LP: #1785354

Description of the change

passno 0 or 1 depending on the values found in /proc/filesystems.

To post a comment you must log in.
Revision history for this message
Dan Bungert (dbungert) wrote : Posted in a previous version of this proposal

One of the last changes broke unit tests, fixing.

Revision history for this message
Ryan Harper (raharper) wrote : Posted in a previous version of this proposal

Thanks for submitting the MR.

<rant>
Personally I don't think this is the right choice to make by default. I don't think we install anything but journaled filesystems in which fsck will merely replay the journal just like the kernel already does. Look at fsck.xfs(8) manpage for a laugh.
</rant>

We should at least:

1) Add a curtin feature flag indicating curtin will now write fstabs which will enable fsck by default (curtin/__init__.py)
2) Add a config option to control the default fstab fsck value (block-meta: fstab_passno_default)
3) sync with MAAS/subiquity so they opt-in to fsck by default feature.
4) Consider not enabling the feature by default such that all MAAS/Subiquity users which move up to newer curtin are generating different installs than they did before the update.

I'll note that both MAAS and subiquity *can* fsck by default today if they construct storage config mount entries with the 'spec' field filled out they way they want.

review: Needs Fixing
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Posted in a previous version of this proposal

In parallel with Ryan writing his comment we found that absolutely nothing in modern Ubuntu cares about passno==1 vs passno==2 so we should definitely drop that logic.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Posted in a previous version of this proposal

We discussed this internally a bit and still think we should change the default. (I haven't heard back from the MAAS team yet). The kernel is not the only thing that reads filesystems (UEFI firmware and grub both do), and for the filesystems that do not implement any kind of non-trivial fsck, we're not at the boot optimization point where adding an invocation of essentially /bin/true will have a noticeable impact. So the (small) upsides seem to outweigh the (even smaller) downsides and I don't think this makes enough difference to anyone to warrant a feature flag.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : Posted in a previous version of this proposal

Also we have changed things so fsck is run in clouds recently after not doing so was causing problems (don't know the details) and we should be consistent about this.

Revision history for this message
Ryan Harper (raharper) wrote : Posted in a previous version of this proposal

> We discussed this internally a bit and still think we should change the

I do wish this sort of discussion would happen either on discourse or
ubuntu-devel/ubuntu-server.

> default. (I haven't heard back from the MAAS team yet). The kernel is not the
> only thing that reads filesystems (UEFI firmware and grub both do), and for

VFAT is not a journaled filesystem, I'm 100% fine with enabling fsck on this.

As for grub the design of journaled filesystems are such that it's always
readable even on crash. Worst case IIUC is a newer files could not show up
until the journal replays.

Additionally, this journal replay (and fsck) happens after grub has run; any
new writes to the filesystem won't have been checked with fsck unless fsck
happens on shutdown (I don't think this is enabled anywhere in Ubuntu) and
still won't help in the case of a crash.

> the filesystems that do not implement any kind of non-trivial fsck, we're not
> at the boot optimization point where adding an invocation of essentially

This isn't a boot optimization; rather it can only slow boot down and for zero
benefit for journaled filesystems.

> /bin/true will have a noticeable impact. So the (small) upsides seem to
> outweigh the (even smaller) downsides and I don't think this makes enough
> difference to anyone to warrant a feature flag.

Changing behavior always warrants feature flags; they're free just like
version bumps. Let's not hide this "feature".

>
> Also we have changed things so fsck is run in clouds recently after not doing
> so was causing problems (don't know the details) and we should be consistent
> about this.

I've been opposed to this as well. For all of the same reasons here and a few
more (cloud instances not being pets, not having interactive consoles to do
repairs, fsck having a non-zero effect on time it takes to mount the rootfs)

Revision history for this message
Dan Bungert (dbungert) wrote :

Thank you for the feedback Ryan.
I've added the FSTAB item to the features list.
The proposal has been redone to not try to be clever about 1 vs 2.
We're planning to take the larger policy discussion to Discourse.
For now, the plan is to address the immediate feedback on the bug reports.
This MP does have an advantage of bringing the various installers into more closely matching behavior.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I started a discourse post for having a deeper conversation about this: https://discourse.ubuntu.com/t/to-fsck-or-not-to-fsck-at-boot-by-default/21478

Revision history for this message
Server Team CI bot (server-team-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Back when I looked at changing this, I also included this in vmtest:

```
diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py
index 0b19d8f8..21a41aaa 100644
--- a/tests/vmtests/__init__.py
+++ b/tests/vmtests/__init__.py
@@ -556,6 +556,8 @@ DEFAULT_COLLECT_SCRIPTS = {
         [ ! -d /etc/default/grub.d ] ||
             cp -a /etc/default/grub.d etc_default_grub_d
         [ ! -f /etc/default/grub ] || cp /etc/default/grub etc_default_grub
+ command -v journalctl && \
+ journalctl -b -o json -u systemd-fsck* > systemd-fsck.json

         exit 0
         """)],
```

I ran all of vmtest and then sampled this output comparing with fsck enabled by default and without. I'll re-run this test locally but I'd like to have another system or two collect as well.

ISTR that enabling fsck on / by default did have a measurable effect to boot time. I'll update the discussion on discord.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I know it's a bit of a pain but I think I would really prefer to avoid emitting passno=1 for tmpfses. One approach would be to have passno == 0 for fstypes marked as "nodev" in /proc/filesystems but maybe that's just silly and you can special case "tmpfs" and "ramfs" (which are the filesystems MAAS supports today that should have passno == 0 by my reading).

review: Needs Fixing
Revision history for this message
Dan Bungert (dbungert) wrote :

@Michael - I believe I've done what has been requested.
@Ryan - I'll start some local data collection now.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

I've been using this:

https://paste.ubuntu.com/p/x2TQ7d2j9v/

which does a better job of collecting boot time (captures systemd-analyze at shutdown time instead of during boot).

I run TestSimple which uses block-meta simple, it defaults to one root partition the size of the entire disk; this allows us to scale the size from (10 (default) to whatever) since fsck is somewhat related to total size of the filesystem it creates.

This loop is what I've used to collect data:

# 1TB, 100GB, 10GB rootfs sizes
for size in 1000 100 10; do
    # 50 tries
    for t in $(seq -w 1 50); do
        # this is where the disks and artifacts will be kept; the IO to/from
        # the virtual disks will happen against this mountpoint
        CURTIN_VMTEST_TOPDIR=/hogshead/blackmetal/curtin/baseline_${size}/${t};
        CURTIN_VMTEST_ROOT_DISK_SIZE_GB=${size}
        # run in parallel for some variance in IO patterns
        # the filter will select just the <Release>TestSimple test cases
        CURTIN_VMTEST_TOPDIR=$CURTIN_VMTEST_TOPDIR \
            ./tools/jenkins-runner -p12 --filter=conf_file=examples/tests/simple.yaml;
    done
done

grep . -r baseline_10/01/XenialTestSimple/collect/systemd-analyze.out
Startup finished in 3.207s (kernel) + 4.459s (userspace) = 7.666s

For now, I've been looking just at total time, and rootfs fsck only, for the
simple test we only have one filesystem; but in other scenarios where we fsck
each fs, that will increase the total boot time.

I've done testing against a high speed (xfs over NVME in raid0), and the
slowest I have access to is zfs over 5-disk raidz2.

I'm still processing the data but should have some results later this week.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

LGTM.

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

Commit message lints:
- Line #4 has 39 too many characters. Line starts with: "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/4/html/reference_guide/s2-proc-filesystem"...

review: Needs Fixing
Revision history for this message
Server Team CI bot (server-team-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/__init__.py b/curtin/__init__.py
2index 0178a7b..aed0def 100644
3--- a/curtin/__init__.py
4+++ b/curtin/__init__.py
5@@ -36,6 +36,8 @@ FEATURES = [
6 'HAS_VERSION_MODULE',
7 # uefi_reoder has fallback support if BootCurrent is missing
8 'UEFI_REORDER_FALLBACK_SUPPORT',
9+ # fstabs by default are output with passno = 1 if not nodev
10+ 'FSTAB_DEFAULT_FSCK_ON_BLK'
11 ]
12
13 __version__ = "21.2"
14diff --git a/curtin/block/schemas.py b/curtin/block/schemas.py
15index 4dc2f0a..7e8e324 100644
16--- a/curtin/block/schemas.py
17+++ b/curtin/block/schemas.py
18@@ -262,6 +262,10 @@ MOUNT = {
19 ],
20 },
21 'spec': {'type': 'string'}, # XXX: Tighten this to fstab fs_spec
22+ 'freq': {'type': ['integer', 'string'],
23+ 'pattern': r'[0-9]'},
24+ 'passno': {'type': ['integer', 'string'],
25+ 'pattern': r'[0-9]'},
26 },
27 }
28 PARTITION = {
29diff --git a/curtin/commands/block_meta.py b/curtin/commands/block_meta.py
30index cf6bc02..b038dd9 100644
31--- a/curtin/commands/block_meta.py
32+++ b/curtin/commands/block_meta.py
33@@ -27,7 +27,7 @@ import time
34 FstabData = namedtuple(
35 "FstabData", ('spec', 'path', 'fstype', 'options', 'freq', 'passno',
36 'device'))
37-FstabData.__new__.__defaults__ = (None, None, None, "", "0", "0", None)
38+FstabData.__new__.__defaults__ = (None, None, None, "", "0", "-1", None)
39
40
41 SIMPLE = 'simple'
42@@ -1020,7 +1020,7 @@ def mount_data(info, storage_config):
43 fstype = info.get('fstype')
44 path = info.get('path')
45 freq = str(info.get('freq', 0))
46- passno = str(info.get('passno', 0))
47+ passno = str(info.get('passno', -1))
48
49 # turn empty options into "defaults", which works in fstab and mount -o.
50 if not info.get('options'):
51@@ -1114,6 +1114,28 @@ def get_volume_spec(device_path):
52 return devlinks[0] if len(devlinks) else device_path
53
54
55+def proc_filesystems_passno(fstype):
56+ """Examine /proc/filesystems - is this fstype listed and marked nodev?
57+
58+ :param fstype: a filesystem name such as ext2 or tmpfs
59+ :return passno for fstype - nodev fs get 0, else 1"""
60+
61+ if fstype in ('swap', 'none'):
62+ return "0"
63+ with open('/proc/filesystems', 'r') as procfs:
64+ for line in procfs.readlines():
65+ tokens = line.strip('\n').split('\t')
66+ if len(tokens) < 2:
67+ continue
68+
69+ devstatus, curfs = tokens[:2]
70+ if curfs != fstype:
71+ continue
72+
73+ return "0" if devstatus == 'nodev' else "1"
74+ return "1"
75+
76+
77 def fstab_line_for_data(fdata):
78 """Return a string representing fdata in /etc/fstab format.
79
80@@ -1151,8 +1173,12 @@ def fstab_line_for_data(fdata):
81 else:
82 comment = None
83
84+ passno = fdata.passno
85+ if int(passno) < 0:
86+ passno = proc_filesystems_passno(fdata.fstype)
87+
88 entry = ' '.join((spec, path, fdata.fstype, options,
89- fdata.freq, fdata.passno)) + "\n"
90+ fdata.freq, passno)) + "\n"
91 line = '\n'.join([comment, entry] if comment else [entry])
92 return line
93
94diff --git a/doc/topics/storage.rst b/doc/topics/storage.rst
95index 75c5537..b20d5c1 100644
96--- a/doc/topics/storage.rst
97+++ b/doc/topics/storage.rst
98@@ -542,6 +542,11 @@ One of ``device`` or ``spec`` must be present.
99 fstab entry will contain ``_netdev`` to indicate networking is
100 required to mount this filesystem.
101
102+**freq**: *<dump(8) integer from 0-9 inclusive>*
103+
104+The ``freq`` key refers to the freq as defined in dump(8).
105+Defaults to ``0`` if unspecified.
106+
107 **fstype**: *<fileystem type>*
108
109 ``fstype`` is only required if ``device`` is not present. It indicates
110@@ -552,7 +557,7 @@ to ``/etc/fstab``
111
112 The ``options`` key will replace the default options value of ``defaults``.
113
114-.. warning::
115+.. warning::
116 The kernel and user-space utilities may differ between the install
117 environment and the runtime environment. Not all kernels and user-space
118 combinations will support all options. Providing options for a mount point
119@@ -565,6 +570,14 @@ The ``options`` key will replace the default options value of ``defaults``.
120 If either of the environments (install or target) do not have support for
121 the provided options, the behavior is undefined.
122
123+**passno**: *<fsck(8) non-negative integer, typically 0-2>*
124+
125+The ``passno`` key refers to the fs_passno as defined in fsck(8).
126+If unspecified, ``curtin`` will default to 1 or 0, depending on if that
127+filesystem is considered to be a 'nodev' device per /proc/filesystems.
128+Note that per systemd-fstab-generator(8), systemd interprets passno as a
129+boolean.
130+
131 **spec**: *<fs_spec>*
132
133 The ``spec`` attribute defines the fsspec as defined in fstab(5).
134diff --git a/examples/tests/filesystem_battery.yaml b/examples/tests/filesystem_battery.yaml
135index 8166360..34657d4 100644
136--- a/examples/tests/filesystem_battery.yaml
137+++ b/examples/tests/filesystem_battery.yaml
138@@ -106,20 +106,24 @@ storage:
139 path: "/my/tmpfs"
140 options: size=4194304
141 fstype: "tmpfs"
142+ passno: 1
143 - id: ramfs1
144 type: mount
145 spec: "none"
146 path: "/my/ramfs"
147 fstype: "ramfs"
148+ passno: 0
149 - id: bind1
150 fstype: "none"
151 options: "bind"
152 path: "/var/cache"
153 spec: "/my/bind-over-var-cache"
154 type: mount
155+ freq: 3
156 - id: bind2
157 fstype: "none"
158 options: "bind,ro"
159 path: "/my/bind-ro-etc"
160 spec: "/etc"
161 type: mount
162+ freq: 1
163diff --git a/tests/unittests/test_commands_block_meta.py b/tests/unittests/test_commands_block_meta.py
164index 8cfd6af..f1a658d 100644
165--- a/tests/unittests/test_commands_block_meta.py
166+++ b/tests/unittests/test_commands_block_meta.py
167@@ -361,7 +361,7 @@ class TestBlockMeta(CiTestCase):
168 block_meta.mount_handler(mount_info, self.storage_config)
169 options = 'defaults'
170 comment = "# / was on /wark/xxx during curtin installation"
171- expected = "%s\n%s %s %s %s 0 0\n" % (comment,
172+ expected = "%s\n%s %s %s %s 0 1\n" % (comment,
173 disk_info['path'],
174 mount_info['path'],
175 fs_info['fstype'], options)
176@@ -389,7 +389,7 @@ class TestBlockMeta(CiTestCase):
177 block_meta.mount_handler(mount_info, self.storage_config)
178 options = 'ro'
179 comment = "# /readonly was on /wark/xxx during curtin installation"
180- expected = "%s\n%s %s %s %s 0 0\n" % (comment,
181+ expected = "%s\n%s %s %s %s 0 1\n" % (comment,
182 disk_info['path'],
183 mount_info['path'],
184 fs_info['fstype'], options)
185@@ -418,7 +418,7 @@ class TestBlockMeta(CiTestCase):
186 block_meta.mount_handler(mount_info, self.storage_config)
187 options = 'defaults'
188 comment = "# /readonly was on /wark/xxx during curtin installation"
189- expected = "%s\n%s %s %s %s 0 0\n" % (comment,
190+ expected = "%s\n%s %s %s %s 0 1\n" % (comment,
191 disk_info['path'],
192 mount_info['path'],
193 fs_info['fstype'], options)
194@@ -449,7 +449,7 @@ class TestBlockMeta(CiTestCase):
195 block_meta.mount_handler(mount_info, self.storage_config)
196 options = 'defaults'
197 comment = "# /readonly was on /wark/xxx during curtin installation"
198- expected = "#curtin-test\n%s\n%s %s %s %s 0 0\n" % (comment,
199+ expected = "#curtin-test\n%s\n%s %s %s %s 0 1\n" % (comment,
200 disk_info['path'],
201 mount_info['path'],
202 fs_info['fstype'],
203@@ -610,7 +610,7 @@ class TestFstabData(CiTestCase):
204 self.assertEqual(
205 block_meta.FstabData(
206 spec="none", fstype="tmpfs", path="/tmpfs",
207- options="defaults", freq="0", passno="0", device=None),
208+ options="defaults", freq="0", device=None),
209 block_meta.mount_data(info, {'xm1': info}))
210
211 @patch('curtin.block.iscsi.volpath_is_iscsi')
212@@ -625,7 +625,7 @@ class TestFstabData(CiTestCase):
213 self.assertEqual(
214 block_meta.FstabData(
215 spec=None, fstype="ext4", path="/",
216- options="noatime", freq="0", passno="0", device="/dev/xda1"),
217+ options="noatime", freq="0", device="/dev/xda1"),
218 block_meta.mount_data(scfg['m1'], scfg))
219
220 @patch('curtin.block.iscsi.volpath_is_iscsi', return_value=False)
221@@ -643,7 +643,7 @@ class TestFstabData(CiTestCase):
222 self.assertEqual(
223 block_meta.FstabData(
224 spec=None, fstype="vfat", path="/boot/efi",
225- options="defaults", freq="0", passno="0", device="/dev/xda1"),
226+ options="defaults", freq="0", device="/dev/xda1"),
227 block_meta.mount_data(scfg['m1'], scfg))
228
229 @patch('curtin.block.iscsi.volpath_is_iscsi')
230@@ -657,7 +657,7 @@ class TestFstabData(CiTestCase):
231 self.assertEqual(
232 block_meta.FstabData(
233 spec=None, fstype="ext4", path="/",
234- options="noatime,_netdev", freq="0", passno="0",
235+ options="noatime,_netdev", freq="0",
236 device="/dev/xda1"),
237 block_meta.mount_data(scfg['m1'], scfg))
238
239@@ -683,7 +683,7 @@ class TestFstabData(CiTestCase):
240 self.assertEqual(
241 block_meta.FstabData(
242 spec=myspec, fstype="ext3", path="/",
243- options="noatime", freq="0", passno="0",
244+ options="noatime", freq="0",
245 device=None),
246 block_meta.mount_data(mnt, scfg))
247
248@@ -761,15 +761,54 @@ class TestFstabData(CiTestCase):
249 spec="/dev/disk2", path="/mnt", fstype='btrfs', options='noatime')
250 lines = block_meta.fstab_line_for_data(fdata).splitlines()
251 self.assertEqual(
252- ["/dev/disk2", "/mnt", "btrfs", "noatime", "0", "0"],
253+ ["/dev/disk2", "/mnt", "btrfs", "noatime", "0", "1"],
254+ lines[1].split())
255+
256+ def test_fstab_line_root_and_no_passno(self):
257+ """fstab_line_for_data passno autoselect for /."""
258+ fdata = block_meta.FstabData(
259+ spec="/dev/disk2", path="/", fstype='btrfs', passno='0',
260+ options='noatime')
261+ lines = block_meta.fstab_line_for_data(fdata).splitlines()
262+ self.assertEqual(
263+ ["/dev/disk2", "/", "btrfs", "noatime", "0", "0"],
264+ lines[1].split())
265+
266+ def test_fstab_line_boot_and_no_passno(self):
267+ """fstab_line_for_data passno autoselect for /boot."""
268+ fdata = block_meta.FstabData(
269+ spec="/dev/disk2", path="/boot", fstype='btrfs', options='noatime')
270+ lines = block_meta.fstab_line_for_data(fdata).splitlines()
271+ self.assertEqual(
272+ ["/dev/disk2", "/boot", "btrfs", "noatime", "0", "1"],
273+ lines[1].split())
274+
275+ def test_fstab_line_boot_efi_and_no_passno(self):
276+ """fstab_line_for_data passno autoselect for /boot/efi."""
277+ fdata = block_meta.FstabData(
278+ spec="/dev/disk2", path="/boot/efi", fstype='btrfs',
279+ options='noatime')
280+ lines = block_meta.fstab_line_for_data(fdata).splitlines()
281+ self.assertEqual(
282+ ["/dev/disk2", "/boot/efi", "btrfs", "noatime", "0", "1"],
283+ lines[1].split())
284+
285+ def test_fstab_line_almost_boot(self):
286+ """fstab_line_for_data passno that pretends to be /boot."""
287+ fdata = block_meta.FstabData(
288+ spec="/dev/disk2", path="/boots", fstype='btrfs',
289+ options='noatime')
290+ lines = block_meta.fstab_line_for_data(fdata).splitlines()
291+ self.assertEqual(
292+ ["/dev/disk2", "/boots", "btrfs", "noatime", "0", "1"],
293 lines[1].split())
294
295 def test_fstab_line_for_data_with_passno_and_freq(self):
296 """fstab_line_for_data should respect passno and freq."""
297 fdata = block_meta.FstabData(
298- spec="/dev/d1", path="/mnt", fstype='ext4', freq="1", passno="2")
299+ spec="/dev/d1", path="/mnt", fstype='ext4', freq="1", passno="1")
300 lines = block_meta.fstab_line_for_data(fdata).splitlines()
301- self.assertEqual(["1", "2"], lines[1].split()[4:6])
302+ self.assertEqual(["1", "1"], lines[1].split()[4:6])
303
304 def test_fstab_line_for_data_raises_error_without_spec_or_device(self):
305 """fstab_line_for_data should raise ValueError if no spec or device."""
306@@ -797,7 +836,7 @@ class TestFstabData(CiTestCase):
307 "# /mnt was on /dev/disk2 during curtin installation",
308 lines[0])
309 self.assertEqual(
310- [by_uuid, "/mnt", "ext4", "defaults", "0", "0"],
311+ [by_uuid, "/mnt", "ext4", "defaults", "0", "1"],
312 lines[1].split())
313 self.assertEqual(1, m_uinfo.call_count)
314 self.assertEqual(1, m_vol_type.call_count)
315@@ -819,7 +858,7 @@ class TestFstabData(CiTestCase):
316 "# /mnt was on /dev/disk2 during curtin installation",
317 lines[0])
318 self.assertEqual(
319- ["/dev/disk2", "/mnt", "ext4", "defaults", "0", "0"],
320+ ["/dev/disk2", "/mnt", "ext4", "defaults", "0", "1"],
321 lines[1].split())
322 self.assertEqual(1, m_uinfo.call_count)
323 self.assertEqual(1, m_vol_type.call_count)
324@@ -837,7 +876,7 @@ class TestFstabData(CiTestCase):
325 '# /mnt was on /dev/xvda1 during curtin installation',
326 lines[0])
327 self.assertEqual(
328- ["/dev/xvda1", "/mnt", "ext4", "defaults", "0", "0"],
329+ ["/dev/xvda1", "/mnt", "ext4", "defaults", "0", "1"],
330 lines[1].split())
331 self.assertEqual(0, m_get_uuid.call_count)
332
333diff --git a/tests/unittests/test_feature.py b/tests/unittests/test_feature.py
334index 8690ad8..0a7f890 100644
335--- a/tests/unittests/test_feature.py
336+++ b/tests/unittests/test_feature.py
337@@ -30,4 +30,7 @@ class TestExportsFeatures(CiTestCase):
338 def test_has_uefi_reorder_fallback_support(self):
339 self.assertIn('UEFI_REORDER_FALLBACK_SUPPORT', curtin.FEATURES)
340
341+ def test_has_fstab_default_fsck_on(self):
342+ self.assertIn('FSTAB_DEFAULT_FSCK_ON_BLK', curtin.FEATURES)
343+
344 # vi: ts=4 expandtab syntax=python
345diff --git a/tests/vmtests/test_fs_battery.py b/tests/vmtests/test_fs_battery.py
346index 7d7b494..cc39f4a 100644
347--- a/tests/vmtests/test_fs_battery.py
348+++ b/tests/vmtests/test_fs_battery.py
349@@ -159,10 +159,10 @@ class TestFsBattery(VMBaseClass):
350 def test_fstab_has_mounts(self):
351 """Verify each of the expected "my" mounts got into fstab."""
352 expected = [
353- "none /my/tmpfs tmpfs size=4194304 0 0".split(),
354+ "none /my/tmpfs tmpfs size=4194304 0 1".split(),
355 "none /my/ramfs ramfs defaults 0 0".split(),
356- "/my/bind-over-var-cache /var/cache none bind 0 0".split(),
357- "/etc /my/bind-ro-etc none bind,ro 0 0".split(),
358+ "/my/bind-over-var-cache /var/cache none bind 3 0".split(),
359+ "/etc /my/bind-ro-etc none bind,ro 1 0".split(),
360 ]
361 fstab_found = [
362 line.split() for line in self.load_collect_file(

Subscribers

People subscribed via source and target branches