pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-cloud-init: make test now works



Module Name:	pkgsrc-wip
Committed By:	Lloyd Parkes <lloyd%must-have-coffee.gen.nz@localhost>
Pushed By:	lloyd
Date:		Wed Nov 18 04:08:10 2026 +0000
Changeset:	20745fd486473233cee3fa4819eaa3f7463de7f6

Modified Files:
	py-cloud-init/Makefile
	py-cloud-init/TODO
	py-cloud-init/distinfo
	py-cloud-init/patches/patch-cloudinit_settings.py
Added Files:
	py-cloud-init/patches/patch-cloudinit_temp__utils.py
	py-cloud-init/patches/patch-cloudinit_util.py
	py-cloud-init/patches/patch-tests_conftest.py
	py-cloud-init/patches/patch-tests_unittests_cmd_devel_test__logs.py
	py-cloud-init/patches/patch-tests_unittests_cmd_test__main.py
	py-cloud-init/patches/patch-tests_unittests_runs_test__merge__run.py
	py-cloud-init/patches/patch-tests_unittests_runs_test__simple__run.py
	py-cloud-init/patches/patch-tests_unittests_test__all__stages.py
	py-cloud-init/patches/patch-tests_unittests_test__temp__utils.py

Log Message:
py-cloud-init: make test now works

Fixed a while pile of broken tests that had the path
/etc/cloud/cloud.cfg hardcoded in them.

Fixed a couple of tests that were broken, incompatible with BSD or
both.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=20745fd486473233cee3fa4819eaa3f7463de7f6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-cloud-init/Makefile                             |  1 +
 py-cloud-init/TODO                                 | 52 +++++++---------------
 py-cloud-init/distinfo                             | 11 ++++-
 py-cloud-init/patches/patch-cloudinit_settings.py  |  9 ++--
 .../patches/patch-cloudinit_temp__utils.py         | 13 ++++++
 py-cloud-init/patches/patch-cloudinit_util.py      | 41 +++++++++++++++++
 py-cloud-init/patches/patch-tests_conftest.py      | 16 +++++++
 .../patch-tests_unittests_cmd_devel_test__logs.py  | 22 +++++++++
 .../patch-tests_unittests_cmd_test__main.py        | 32 +++++++++++++
 .../patch-tests_unittests_runs_test__merge__run.py | 16 +++++++
 ...patch-tests_unittests_runs_test__simple__run.py | 45 +++++++++++++++++++
 .../patch-tests_unittests_test__all__stages.py     | 49 ++++++++++++++++++++
 .../patch-tests_unittests_test__temp__utils.py     | 25 +++++++++++
 13 files changed, 290 insertions(+), 42 deletions(-)

diffs:
diff --git a/py-cloud-init/Makefile b/py-cloud-init/Makefile
index 61f1a73204..cb0462aedf 100644
--- a/py-cloud-init/Makefile
+++ b/py-cloud-init/Makefile
@@ -27,6 +27,7 @@ TEST_DEPENDS+=	${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
 TEST_DEPENDS+=	${PYPKGPREFIX}-test-cov-[0-9]*:../../devel/py-test-cov
 TEST_DEPENDS+=	${PYPKGPREFIX}-test-mock-[0-9]*:../../devel/py-test-mock
 TEST_DEPENDS+=	${PYPKGPREFIX}-passlib-[0-9]*:../../security/py-passlib
+TEST_DEPENDS+=	${PYPKGPREFIX}-fakefs-[0-9]*:../../devel/py-fakefs
 
 MESON_ARGS+=	-Dinit_system=sysvinit_netbsd
 MESON_ARGS+=	-Dbash_completion=false
diff --git a/py-cloud-init/TODO b/py-cloud-init/TODO
index aa054743a7..a5ed247ebf 100644
--- a/py-cloud-init/TODO
+++ b/py-cloud-init/TODO
@@ -1,40 +1,22 @@
 Ref.
   https://bugs.launchpad.net/cloud-init/+bug/2006065
 
+Make the settings.py hacks less hacky.
+
+Find out why EC2 instance data isn't being cached / stored.
+
+Find out if I need to alter /run/... to /var/run/... in
+settings.py. Maybe just having it set correctly in cloud.cfg is good
+enough?
+
+Move /var/lib/cloud to /var/db/cloud.
+
+Re-disable ssh-keygen by default.
+
 Make sure that this package is doing something actually useful.
 
-Review the Makefile.
-
-Fix self tests so they succeed (or the relevant tests are skipped on NetBSD):
-
- * TestGetLinuxDistro.test_get_linux_distro_no_data
-   TestGetLinuxDistro.test_get_linux_distro_no_impl
-   TestGetLinuxDistro.test_get_linux_distro_plat_data
-   These should probably be skipped.
-
- * TestParseTimestamp.test_parse_unexpected_timestamp_format_with_date_command
-   Expects "date" to behave as on Linux.
-   GNUism.  Should probably be skipped.
-
- * TestClean.test_remove_artifacts_runparts_clean_d
-   Have not figured out what that's about.
-   Assumption that /bin/bash exists, it looks like?
-   Linuxism...
-
- * TestAzureDataSource.test_crawl_metadata_on_reprovision_reports_ready_using_lease
-   TestPreprovisioningHotAttachNics.test_detect_nic_attach_reports_ready_and_waits_for_detach
-   TestPreprovisioningHotAttachNics.test_wait_for_nic_attach_multinic_attach
-   TestPreprovisioningPollIMDS.test_poll_imds_re_dhcp_on_timeout
-   TestPreprovisioningPollIMDS.test_poll_imds_report_ready_failure_raises_exc_and_doesnt_write_marker
-   TestPreprovisioningPollIMDS.test_poll_imds_report_ready_success_writes_marker_file
-   TestAzureDataSourcePreprovisioning.test__reprovision_calls__poll_imds
-   TestAzureDataSourcePreprovisioning.test_poll_imds_returns_ovf_env
-   TestDatasourceOVF.test_get_data_iso9660_with_network_config
-   TestCreateBoundNetlinkSocket.test_socket_error_on_create
-
-   AttributeError: module 'socket' has no attribute 'AF_NETLINK'. Did you mean: 'AF_LINK'?
-   Another Linuxism.
-
- * TestDataSourceVMware.test_no_data_access_method
-   Exception: called subp. set self.allowed_subp=True to allow
-   can't run dmidecode as unprivileged user
+Review the Makefile and move the meson options into options.mk.
+
+I found a ton of directories in /tmp each of which seemed to have a
+script in it called ds-identify after running "make test". This is
+clearly not right.
diff --git a/py-cloud-init/distinfo b/py-cloud-init/distinfo
index d26c3a5e55..b129dd14dd 100644
--- a/py-cloud-init/distinfo
+++ b/py-cloud-init/distinfo
@@ -3,6 +3,15 @@ $NetBSD$
 BLAKE2s (cloud-init-26.2.tar.gz) = fbbce7a8478e22ccd1976158b14cbf539a5c1df5c3eb397ef97025981862527d
 SHA512 (cloud-init-26.2.tar.gz) = 9cf225ae89d47772fe33a0e784f22a45cfc299e72b1f2b1a1b933f1b99f64fcd3700382bb1991c440788a14b748fc613dbee63312c206d138ba1faf8cebbb22b
 Size (cloud-init-26.2.tar.gz) = 1951605 bytes
-SHA1 (patch-cloudinit_settings.py) = 960f04590bd5932ff5a52e2cf40fb576568f1c4e
+SHA1 (patch-cloudinit_settings.py) = f716bb595904843d4910f8d55056ecc25691794e
+SHA1 (patch-cloudinit_temp__utils.py) = 4219b6ba7855598a52f3d86f8006784d44c6513a
+SHA1 (patch-cloudinit_util.py) = f129feea315466b5b34cfdb7dcd0a2843aa87f42
 SHA1 (patch-meson.build) = 6ff93a93c58d00c1353c07d5f3a724a1723569b6
 SHA1 (patch-meson__options.txt) = b360c071948deeb76802e426d6b290438f2dfd32
+SHA1 (patch-tests_conftest.py) = 083efdf07a967f9068639e5d3044d7ef2263ef10
+SHA1 (patch-tests_unittests_cmd_devel_test__logs.py) = 7c64386814af9da2fc12af215b2d9d798b4af792
+SHA1 (patch-tests_unittests_cmd_test__main.py) = 7b5dc9e1103e183e9ca859361746eb3e95ff1944
+SHA1 (patch-tests_unittests_runs_test__merge__run.py) = 3ebbbbfe34740c11ba4fd97f3cedd37ec9f29d9b
+SHA1 (patch-tests_unittests_runs_test__simple__run.py) = 6085f9ec94d3a38aeba97dd03eae8dc45a5400f0
+SHA1 (patch-tests_unittests_test__all__stages.py) = c939812760802f24a78810e17a53a690af30c75b
+SHA1 (patch-tests_unittests_test__temp__utils.py) = ba7fd970394245a7828528c8b90965991b31c59d
diff --git a/py-cloud-init/patches/patch-cloudinit_settings.py b/py-cloud-init/patches/patch-cloudinit_settings.py
index 8520230554..2eecf9d9f5 100644
--- a/py-cloud-init/patches/patch-cloudinit_settings.py
+++ b/py-cloud-init/patches/patch-cloudinit_settings.py
@@ -1,8 +1,8 @@
 $NetBSD$
 
---- cloudinit/settings.py.orig	2026-11-14 20:35:04.420832518 +0000
+--- cloudinit/settings.py.orig	2026-07-27 14:56:24.000000000 +0000
 +++ cloudinit/settings.py
-@@ -12,11 +12,11 @@ CFG_ENV_NAME = "CLOUD_CFG"
+@@ -12,9 +12,9 @@ CFG_ENV_NAME = "CLOUD_CFG"
  CFG_ENV_NAME = "CLOUD_CFG"
  
  # This is expected to be a yaml formatted file
@@ -12,8 +12,5 @@ $NetBSD$
 -CLEAN_RUNPARTS_DIR = "/etc/cloud/clean.d"
 +CLEAN_RUNPARTS_DIR = "/usr/pkg/etc/cloud/clean.d"
  
--DEFAULT_RUN_DIR = "/run/cloud-init"
-+DEFAULT_RUN_DIR = "/var/run/cloud-init"
+ DEFAULT_RUN_DIR = "/run/cloud-init"
  
- # What u get if no config is provided
- CFG_BUILTIN = {
diff --git a/py-cloud-init/patches/patch-cloudinit_temp__utils.py b/py-cloud-init/patches/patch-cloudinit_temp__utils.py
new file mode 100644
index 0000000000..3e78fb4338
--- /dev/null
+++ b/py-cloud-init/patches/patch-cloudinit_temp__utils.py
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- cloudinit/temp_utils.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ cloudinit/temp_utils.py
+@@ -21,7 +21,7 @@ def get_tmp_ancestor(odir=None, needs_exe: bool = Fals
+         return _EXE_ROOT_TMPDIR
+     if os.getuid() == 0:
+         if util.is_BSD():
+-            return "/var/" + _ROOT_TMPDIR
++            return "/var" + _ROOT_TMPDIR
+         else:
+             return _ROOT_TMPDIR
+     return os.environ.get("TMPDIR", "/tmp")
diff --git a/py-cloud-init/patches/patch-cloudinit_util.py b/py-cloud-init/patches/patch-cloudinit_util.py
new file mode 100644
index 0000000000..b53f79548b
--- /dev/null
+++ b/py-cloud-init/patches/patch-cloudinit_util.py
@@ -0,0 +1,41 @@
+$NetBSD$
+
+--- cloudinit/util.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ cloudinit/util.py
+@@ -74,7 +74,7 @@ from cloudinit.log.log_util import logexc
+     version,
+ )
+ from cloudinit.log.log_util import logexc
+-from cloudinit.settings import CFG_BUILTIN, PER_ONCE
++from cloudinit.settings import CFG_BUILTIN, PER_ONCE, CLOUD_CONFIG
+ 
+ if TYPE_CHECKING:
+     # Avoid circular import
+@@ -2329,6 +2329,27 @@ def write_file(
+             fh.flush()
+     chmod(filename, mode)
+ 
++def write_cloud_config(
++    new_root,
++    content,
++    mode=0o644,
++):
++    """
++    Writes a cloud.cfg with the given content and sets the file mode
++    as specified.
++    The filename used is the system default location with new_root prepended.
++    Restores the SELinux context if possible.
++
++    @param new_root: The path to use instead of /.
++    @param content: The content to write to the file.
++    @param mode: The filesystem mode to set on the file.
++
++    """
++
++    rootless_config = os.path.splitroot(CLOUD_CONFIG)[2]
++    filename = os.path.join(new_root, rootless_config)
++    write_file(filename, content, mode=mode, ensure_dir_exists=True)
++    return filename
+ 
+ def delete_dir_contents(dirname):
+     """
diff --git a/py-cloud-init/patches/patch-tests_conftest.py b/py-cloud-init/patches/patch-tests_conftest.py
new file mode 100644
index 0000000000..033da3c6f1
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_conftest.py
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- tests/conftest.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/conftest.py
+@@ -159,7 +159,10 @@ def disable_subp_usage(request, fixture_utils):
+         real_subp = subp.subp
+ 
+         def side_effect(args, *other_args, **kwargs):
+-            cmd = args[0]
++            if isinstance(args, list):
++                cmd = args[0]
++            else:
++                cmd = args
+             if cmd not in allow_subp_for:
+                 raise UnexpectedSubpError(
+                     "Unexpectedly used subp.subp to call {} (allowed:"
diff --git a/py-cloud-init/patches/patch-tests_unittests_cmd_devel_test__logs.py b/py-cloud-init/patches/patch-tests_unittests_cmd_devel_test__logs.py
new file mode 100644
index 0000000000..364f9bf829
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_cmd_devel_test__logs.py
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- tests/unittests/cmd/devel/test_logs.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/cmd/devel/test_logs.py
+@@ -179,7 +179,7 @@ class TestCollectLogs:
+ 
+         for to_write in to_collect:
+             write_file(
+-                tmp_path / to_write, pathlib.Path(to_write).name, mode=0x700
++                tmp_path / to_write, pathlib.Path(to_write).name, mode=0o400
+             )
+ 
+         collect_dir = tmp_path / "collect"
+@@ -225,7 +225,7 @@ class TestCollectLogs:
+ 
+         for to_write in to_collect:
+             write_file(
+-                tmp_path / to_write, pathlib.Path(to_write).name, mode=0x700
++                tmp_path / to_write, pathlib.Path(to_write).name, mode=0o700
+             )
+ 
+         collect_dir = tmp_path / "collect"
diff --git a/py-cloud-init/patches/patch-tests_unittests_cmd_test__main.py b/py-cloud-init/patches/patch-tests_unittests_cmd_test__main.py
new file mode 100644
index 0000000000..6d9dafccaf
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_cmd_test__main.py
@@ -0,0 +1,32 @@
+$NetBSD$
+
+--- tests/unittests/cmd/test_main.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/cmd/test_main.py
+@@ -11,7 +11,7 @@ from cloudinit.cmd import main
+ 
+ from cloudinit import features, safeyaml, util
+ from cloudinit.cmd import main
+-from cloudinit.util import ensure_dir, load_text_file, write_file
++from cloudinit.util import ensure_dir, load_text_file, write_file, write_cloud_config
+ 
+ MyArgs = namedtuple(
+     "MyArgs", "debug files force local reporter subcommand skip_log_setup"
+@@ -63,9 +63,7 @@ class TestMain:
+         cloud_dir = os.path.join(tmpdir, "var/lib/cloud/")
+         log_dir = os.path.join(tmpdir, "var/log/")
+         ensure_dir(cloud_dir)
+-        ensure_dir(os.path.join(tmpdir, "etc/cloud"))
+         ensure_dir(log_dir)
+-        cloud_cfg_file = os.path.join(tmpdir, "etc/cloud/cloud.cfg")
+ 
+         cfg = {
+             "datasource_list": ["None"],
+@@ -88,7 +86,7 @@ class TestMain:
+             ],
+             "cloud_init_modules": ["write_files", "runcmd"],
+         }
+-        write_file(cloud_cfg_file, safeyaml.dumps(cfg))
++        cloud_cfg_file = write_cloud_config(tmpdir, safeyaml.dumps(cfg))
+         yield copy.deepcopy(cfg), cloud_cfg_file
+ 
+     @pytest.mark.parametrize(
diff --git a/py-cloud-init/patches/patch-tests_unittests_runs_test__merge__run.py b/py-cloud-init/patches/patch-tests_unittests_runs_test__merge__run.py
new file mode 100644
index 0000000000..f7b74b0360
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_runs_test__merge__run.py
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- tests/unittests/runs/test_merge_run.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/runs/test_merge_run.py
+@@ -41,10 +41,7 @@ def cfg(tmp_path, mocker):
+         },
+     }
+     cloud_cfg = safeyaml.dumps(cfg)
+-    util.ensure_dir(os.path.join(new_root, "etc", "cloud"))
+-    util.write_file(
+-        os.path.join(new_root, "etc", "cloud", "cloud.cfg"), cloud_cfg
+-    )
++    util.write_cloud_config(new_root, cloud_cfg)
+ 
+ 
+ @pytest.mark.usefixtures("fake_filesystem")
diff --git a/py-cloud-init/patches/patch-tests_unittests_runs_test__simple__run.py b/py-cloud-init/patches/patch-tests_unittests_runs_test__simple__run.py
new file mode 100644
index 0000000000..2998da7ac4
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_runs_test__simple__run.py
@@ -0,0 +1,45 @@
+$NetBSD$
+
+--- tests/unittests/runs/test_simple_run.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/runs/test_simple_run.py
+@@ -7,7 +7,7 @@ from cloudinit.config.modules import Modules
+ 
+ from cloudinit import atomic_helper, safeyaml, stages, util
+ from cloudinit.config.modules import Modules
+-from cloudinit.settings import PER_INSTANCE
++from cloudinit.settings import PER_INSTANCE, CLOUD_CONFIG
+ from cloudinit.sources import NetworkConfigSource
+ from tests.unittests.helpers import replicate_test_root
+ 
+@@ -41,10 +41,7 @@ def cfg(mocker, tmp_path):
+         "cloud_init_modules": ["write_files", "spacewalk", "runcmd"],
+     }
+     cloud_cfg = safeyaml.dumps(_cfg)
+-    util.ensure_dir(os.path.join(new_root, "etc", "cloud"))
+-    util.write_file(
+-        os.path.join(new_root, "etc", "cloud", "cloud.cfg"), cloud_cfg
+-    )
++    util.write_cloud_config(new_root, cloud_cfg)
+     return _cfg
+ 
+ 
+@@ -172,8 +169,7 @@ class TestSimpleRun:
+         cfg = copy.deepcopy(cfg)
+         cfg["unverified_modules"] = ["spacewalk"]  # Would have skipped
+         cloud_cfg = safeyaml.dumps(cfg)
+-        util.ensure_dir(os.path.join("/etc", "cloud"))
+-        util.write_file(os.path.join("/etc", "cloud", "cloud.cfg"), cloud_cfg)
++        util.write_file(CLOUD_CONFIG, cloud_cfg, ensure_dir_exists=True)
+ 
+         initer = stages.Init()
+         initer.read_cfg()
+@@ -202,8 +198,7 @@ class TestSimpleRun:
+         # Represent empty configuration in /etc/cloud/cloud.cfg
+         cfg["cloud_init_modules"] = None
+         cloud_cfg = safeyaml.dumps(cfg)
+-        util.ensure_dir(os.path.join("/etc", "cloud"))
+-        util.write_file(os.path.join("/etc", "cloud", "cloud.cfg"), cloud_cfg)
++        util.write_file(CLOUD_CONFIG, cloud_cfg, ensure_dir_exists=True)
+ 
+         initer = stages.Init()
+         initer.read_cfg()
diff --git a/py-cloud-init/patches/patch-tests_unittests_test__all__stages.py b/py-cloud-init/patches/patch-tests_unittests_test__all__stages.py
new file mode 100644
index 0000000000..4dcdbc01a1
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_test__all__stages.py
@@ -0,0 +1,49 @@
+$NetBSD$
+
+--- tests/unittests/test_all_stages.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/test_all_stages.py
+@@ -5,9 +5,11 @@ from unittest import mock
+ from threading import Thread
+ from unittest import mock
+ 
++import pytest
++
+ from cloudinit import socket as ci_socket
++from cloudinit.distros import uses_systemd
+ 
+-
+ class Sync:
+     """A device to send and receive synchronization messages
+ 
+@@ -47,6 +49,7 @@ class Timeout:
+         signal.alarm(0)
+ 
+ 
++@pytest.mark.skipif(not uses_systemd(), reason="Tests comms with systemd")
+ def test_all_stages_times_out(tmp_path, socket_attrs):
+     """Verify that no "start" makes the protocol block"""
+     with mock.patch.object(
+@@ -70,6 +73,7 @@ def test_all_stages_times_out(tmp_path, socket_attrs):
+             raise AssertionError("Expected the thing to timeout!")
+ 
+ 
++@pytest.mark.skipif(not uses_systemd(), reason="Tests comms with systemd")
+ def test_all_stages(tmp_path, socket_attrs):
+     """Verify that a socket can store "start" messages
+ 
+@@ -108,6 +112,7 @@ def test_all_stages(tmp_path, socket_attrs):
+         assert expected.format("third").encode() == third.receive()
+ 
+ 
++@pytest.mark.skipif(not uses_systemd(), reason="Tests comms with systemd")
+ def test_all_stages_threaded(tmp_path, socket_attrs):
+     """Verify that arbitrary "start" order works"""
+ 
+@@ -181,6 +186,7 @@ def test_all_stages_threaded(tmp_path, socket_attrs):
+         assert expected.format("fifth").encode() == sync_storage[5].receive()
+ 
+ 
++@pytest.mark.skipif(not uses_systemd(), reason="Tests comms with systemd")
+ def test_all_stages_exception(tmp_path, socket_attrs):
+     """Verify that exceptions log messages produce a valid warning message"""
+     with mock.patch.object(
diff --git a/py-cloud-init/patches/patch-tests_unittests_test__temp__utils.py b/py-cloud-init/patches/patch-tests_unittests_test__temp__utils.py
new file mode 100644
index 0000000000..4bf7fe4072
--- /dev/null
+++ b/py-cloud-init/patches/patch-tests_unittests_test__temp__utils.py
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- tests/unittests/test_temp_utils.py.orig	2026-07-27 14:56:24.000000000 +0000
++++ tests/unittests/test_temp_utils.py
+@@ -76,7 +76,8 @@ class TestTempUtils:
+             mkdtemp,
+         )
+         assert "/fake/return/path" == retval
+-        assert [{"dir": "/run/cloud-init/tmp"}] == calls
++        assert calls[0]["dir"].endswith("/run/cloud-init/tmp")
++        #assert [{"dir": "/run/cloud-init/tmp"}] == calls
+ 
+     def test_mkstemp_default_non_root(self):
+         """mkstemp creates secure tempfile under /tmp for the unprivileged."""
+@@ -118,7 +119,9 @@ class TestTempUtils:
+             mkstemp,
+         )
+         assert "/fake/return/path" == retval
+-        assert [{"dir": "/run/cloud-init/tmp"}] == calls
++        # BSD has /var/run/... while Linux has /run/...
++        assert calls[0]["dir"].endswith("/run/cloud-init/tmp")
++        #assert [{"dir": "/run/cloud-init/tmp"}] == calls
+ 
+     def test_tempdir_error_suppression(self):
+         """test tempdir suppresses errors during directory removal."""


Home | Main Index | Thread Index | Old Index