Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add integration test for LP: #1886531 #592

Merged
merged 1 commit into from Oct 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/integration_tests/bugs/test_lp1886531.py
@@ -0,0 +1,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 /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