summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-04-16 11:23:08 -0400
committergit-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com>2020-04-16 16:26:05 +0000
commit31ca6c5d4f2dde4c04d0a099845a962f0cba42bd (patch)
tree1afe321809f324eafbe99156fa332d18dffc896d
parent35510940b3db7a136c44334cd6335b75c588a075 (diff)
downloadcloud-init-git-31ca6c5d4f2dde4c04d0a099845a962f0cba42bd.tar.gz
20.1-10-g71af48df-0ubuntu5 (patches unapplied)
Imported using git-ubuntu import.
-rw-r--r--debian/changelog7
-rw-r--r--debian/patches/cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths41
-rw-r--r--debian/patches/series1
3 files changed, 49 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 150dd000..5523dfa2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+cloud-init (20.1-10-g71af48df-0ubuntu5) focal; urgency=medium
+
+ * cherry-pick 0c5c7367: test_mounts: expand happy path test for both
+ happy paths
+
+ -- Daniel Watkins <oddbloke@ubuntu.com> Thu, 16 Apr 2020 11:23:08 -0400
+
cloud-init (20.1-10-g71af48df-0ubuntu4) focal; urgency=medium
* cherry-pick 9d7b35ce: cc_mounts: fix incorrect format specifiers
diff --git a/debian/patches/cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths b/debian/patches/cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths
new file mode 100644
index 00000000..b03940a4
--- /dev/null
+++ b/debian/patches/cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths
@@ -0,0 +1,41 @@
+From 0c5c736727d0f8e363678fe970d70bb889e3893c Mon Sep 17 00:00:00 2001
+From: Daniel Watkins <oddbloke@ubuntu.com>
+Date: Thu, 16 Apr 2020 11:18:36 -0400
+Subject: [PATCH] test_mounts: expand happy path test for both happy paths
+ (#319)
+
+---
+ cloudinit/config/tests/test_mounts.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/cloudinit/config/tests/test_mounts.py
++++ b/cloudinit/config/tests/test_mounts.py
+@@ -1,6 +1,8 @@
+ # This file is part of cloud-init. See LICENSE file for license information.
+ from unittest import mock
+
++import pytest
++
+ from cloudinit.config.cc_mounts import create_swapfile
+
+
+@@ -9,8 +11,10 @@ M_PATH = 'cloudinit.config.cc_mounts.'
+
+ class TestCreateSwapfile:
+
++ @pytest.mark.parametrize('fstype', ('xfs', 'btrfs', 'ext4', 'other'))
++ @mock.patch(M_PATH + 'util.get_mount_info')
+ @mock.patch(M_PATH + 'util.subp')
+- def test_happy_path(self, m_subp, tmpdir):
++ def test_happy_path(self, m_subp, m_get_mount_info, fstype, tmpdir):
+ swap_file = tmpdir.join("swap-file")
+ fname = str(swap_file)
+
+@@ -18,5 +22,7 @@ class TestCreateSwapfile:
+ # roughly approximates that
+ m_subp.side_effect = lambda *args, **kwargs: swap_file.write('')
+
++ m_get_mount_info.return_value = (mock.ANY, fstype)
++
+ create_swapfile(fname, '')
+ assert mock.call(['mkswap', fname]) in m_subp.call_args_list
diff --git a/debian/patches/series b/debian/patches/series
index 85d0539d..61704533 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ cpick-1bbc4908-distros-drop-leading-trailing-hyphens-from-mirror-URL
cpick-09fea85f-net-ignore-renderer-key-in-netplan-config-306
fix-cpick-4fb6fd8a-net-ubuntu-focal-prioritize-netplan-over-eni.patch
cpick-9d7b35ce-cc_mounts-fix-incorrect-format-specifiers-316
+cpick-0c5c7367-test_mounts-expand-happy-path-test-for-both-happy-paths