summaryrefslogtreecommitdiff
path: root/tests/integration_tests/bugs/test_lp1886531.py
blob: 058ea8bb4e5523e452152ff22b7d9bb0f42d1696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Integration test for LP: #1886531

This test replicates the failure condition (absent /etc/fstab) on all releases
by removing it in a bootcmd; this runs well before the part of cloud-init which
causes the failure.

The only required assertion is that cloud-init does not emit a WARNING to the
log: this indicates that the fstab parsing code has not failed.

https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1886531
"""
import pytest


USER_DATA = """\
#cloud-config
bootcmd:
- rm -f /etc/fstab
"""


class TestLp1886531:

    @pytest.mark.user_data(USER_DATA)
    def test_lp1886531(self, client):
        log_content = client.read_from_file("/var/log/cloud-init.log")
        assert "WARNING" not in log_content