testcloud 0.11.3__tar.gz → 0.11.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {testcloud-0.11.3/testcloud.egg-info → testcloud-0.11.4}/PKG-INFO +1 -1
  2. {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/conf.py +1 -1
  3. {testcloud-0.11.3 → testcloud-0.11.4}/test/test_config.py +15 -0
  4. {testcloud-0.11.3 → testcloud-0.11.4}/test/test_image.py +15 -0
  5. {testcloud-0.11.3 → testcloud-0.11.4}/test/test_instance.py +16 -2
  6. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/__init__.py +1 -1
  7. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/ubuntu.py +1 -1
  8. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/instance.py +3 -3
  9. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/util.py +2 -2
  10. {testcloud-0.11.3 → testcloud-0.11.4/testcloud.egg-info}/PKG-INFO +1 -1
  11. {testcloud-0.11.3 → testcloud-0.11.4}/.gitignore +0 -0
  12. {testcloud-0.11.3 → testcloud-0.11.4}/LICENSE +0 -0
  13. {testcloud-0.11.3 → testcloud-0.11.4}/README.md +0 -0
  14. {testcloud-0.11.3 → testcloud-0.11.4}/conf/99-testcloud-nonroot-libvirt-access.rules +0 -0
  15. {testcloud-0.11.3 → testcloud-0.11.4}/conf/settings-example.py +0 -0
  16. {testcloud-0.11.3 → testcloud-0.11.4}/conf/testcloud +0 -0
  17. {testcloud-0.11.3 → testcloud-0.11.4}/docs/LICENSE +0 -0
  18. {testcloud-0.11.3 → testcloud-0.11.4}/docs/Makefile +0 -0
  19. {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/api.rst +0 -0
  20. {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/indepth.rst +0 -0
  21. {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/index.rst +0 -0
  22. {testcloud-0.11.3 → testcloud-0.11.4}/manpages/testcloud.1 +0 -0
  23. {testcloud-0.11.3 → testcloud-0.11.4}/pyproject.toml +0 -0
  24. {testcloud-0.11.3 → testcloud-0.11.4}/requirements.txt +0 -0
  25. {testcloud-0.11.3 → testcloud-0.11.4}/run_testcloud.py +0 -0
  26. {testcloud-0.11.3 → testcloud-0.11.4}/setup.cfg +0 -0
  27. {testcloud-0.11.3 → testcloud-0.11.4}/setup.py +0 -0
  28. {testcloud-0.11.3 → testcloud-0.11.4}/test/__init__.py +0 -0
  29. {testcloud-0.11.3 → testcloud-0.11.4}/test/test_cli.py +0 -0
  30. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/cli.py +0 -0
  31. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/config.py +0 -0
  32. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/__init__.py +0 -0
  33. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/alma.py +0 -0
  34. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/centos.py +0 -0
  35. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/debian.py +0 -0
  36. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/fedora.py +0 -0
  37. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/misc.py +0 -0
  38. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/oracle.py +0 -0
  39. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/rocky.py +0 -0
  40. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/domain_configuration.py +0 -0
  41. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/exceptions.py +0 -0
  42. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/image.py +0 -0
  43. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/sql.py +0 -0
  44. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/workarounds.py +0 -0
  45. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/SOURCES.txt +0 -0
  46. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/dependency_links.txt +0 -0
  47. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/entry_points.txt +0 -0
  48. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/requires.txt +0 -0
  49. {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/top_level.txt +0 -0
  50. {testcloud-0.11.3 → testcloud-0.11.4}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testcloud
3
- Version: 0.11.3
3
+ Version: 0.11.4
4
4
  Summary: A tool to download and boot cloud images locally, with an easy to use API.
5
5
  Home-page: https://pagure.io/testcloud
6
6
  Author: Mike Ruckman
@@ -55,7 +55,7 @@ copyright = "2016-2024, testCloud devs"
55
55
  # built documents.
56
56
  #
57
57
  # The short X.Y version.
58
- version = "0.11.3"
58
+ version = "0.11.4"
59
59
  # The full version, including alpha/beta/rc tags.
60
60
  release = version
61
61
 
@@ -3,8 +3,14 @@
3
3
  # License: GPL-2.0+ <http://spdx.org/licenses/GPL-2.0+>
4
4
  # See the LICENSE file for more details on Licensing
5
5
 
6
+ from unittest.mock import patch
7
+
8
+ import peewee as pw
9
+
6
10
  from testcloud import config
11
+ from testcloud.sql import DBImage, DB
7
12
 
13
+ DB = pw.SqliteDatabase(":memory:")
8
14
 
9
15
  REF_DATA_DIR = "/some/random/dir/for/testing/"
10
16
  REF_STORE_DIR = "/some/random/dir/for/testing/backingstore/"
@@ -16,6 +22,15 @@ STORE_DIR = "{}/backingstores"
16
22
  class TestConfig(object):
17
23
  def setup_method(self, method):
18
24
  config._config = None
25
+ DB.bind([DBImage], bind_refs=False, bind_backrefs=False)
26
+ DB.connect()
27
+ DB.create_tables([DBImage])
28
+ self.patcher = patch('testcloud.sql.data_dir_changed', return_value=None)
29
+ self.mocked_method = self.patcher.start()
30
+
31
+ def teardown_method(self, method):
32
+ DB.drop_tables([DBImage])
33
+ DB.close()
19
34
 
20
35
  def test_get_config_object(self, monkeypatch):
21
36
  """Simple test to grab a config object, will return default config
@@ -5,11 +5,16 @@
5
5
 
6
6
  """ This module is for testing the behaviour of the Image class."""
7
7
 
8
+ from unittest.mock import patch
9
+
8
10
  import pytest
11
+ import peewee as pw
9
12
 
10
13
  from testcloud import image
11
14
  from testcloud import exceptions
15
+ from testcloud.sql import DBImage, DB
12
16
 
17
+ DB = pw.SqliteDatabase(":memory:")
13
18
 
14
19
  class TestImage:
15
20
 
@@ -40,6 +45,16 @@ class TestImageUriProcess(object):
40
45
  self.image_name = "image.img"
41
46
  self.len_data = 3
42
47
 
48
+ DB.bind([DBImage], bind_refs=False, bind_backrefs=False)
49
+ DB.connect()
50
+ DB.create_tables([DBImage])
51
+ self.patcher = patch('testcloud.sql.data_dir_changed', return_value=None)
52
+ self.mocked_method = self.patcher.start()
53
+
54
+ def teardown_method(self, method):
55
+ DB.drop_tables([DBImage])
56
+ DB.close()
57
+
43
58
  def test_http_ur1(self):
44
59
  ref_type = "http"
45
60
  ref_path = "localhost/images/{}".format(self.image_name)
@@ -5,12 +5,17 @@
5
5
 
6
6
  """ This module is for testing the behaviour of the Image class."""
7
7
 
8
+ from unittest import mock
9
+ from unittest.mock import patch
10
+
8
11
  import os
12
+ import peewee as pw
9
13
 
10
- from unittest import mock
11
14
 
12
- from testcloud import instance, image, config, domain_configuration
15
+ from testcloud import instance, image, config
16
+ from testcloud.sql import DBImage, DB
13
17
 
18
+ DB = pw.SqliteDatabase(":memory:")
14
19
 
15
20
  class dotdict(dict):
16
21
  # https://stackoverflow.com/a/23689767
@@ -45,6 +50,15 @@ class TestFindInstance(object):
45
50
 
46
51
  def setup_method(self, method):
47
52
  self.conf = config.ConfigData()
53
+ DB.bind([DBImage], bind_refs=False, bind_backrefs=False)
54
+ DB.connect()
55
+ DB.create_tables([DBImage])
56
+ self.patcher = patch('testcloud.sql.data_dir_changed', return_value=None)
57
+ self.mocked_method = self.patcher.start()
58
+
59
+ def teardown_method(self, method):
60
+ DB.drop_tables([DBImage])
61
+ DB.close()
48
62
 
49
63
  def test_non_existant_instance(self, monkeypatch):
50
64
  ref_name = "test-123"
@@ -1,5 +1,5 @@
1
1
  # NOTE: if you update version, *make sure* to also update `docs/source/conf.py`
2
- __version__ = "0.11.3"
2
+ __version__ = "0.11.4"
3
3
 
4
4
  import signal
5
5
  import sys
@@ -24,7 +24,7 @@ def get_ubuntu_releases() -> dict:
24
24
  raise exceptions.TestcloudImageError
25
25
 
26
26
  return {
27
- "latest": [entry["name"] for entry in releases_resp["entries"] if entry["active"] and "Dev" not in entry["status"]][0],
27
+ "latest": [entry["name"] for entry in releases_resp["entries"] if entry["active"] and "Current Stable Release" in entry["status"]][0],
28
28
  "entries": [entry["name"] for entry in releases_resp["entries"] if entry["active"] and float(entry["version"]) >= 20],
29
29
  }
30
30
 
@@ -339,13 +339,13 @@ class Instance(object):
339
339
  self.workarounds.add_condition(
340
340
  '[ ! -f /etc/systemd/system/testcloud.service ]',
341
341
  [
342
- 'echo "{0}" >> /opt/testcloud-guest.sh'.format(simple_http_start_guest),
343
- 'chmod +x /opt/testcloud-guest.sh',
342
+ 'echo "{0}" >> /etc/testcloud-guest.sh'.format(simple_http_start_guest),
343
+ 'chmod +x /etc/testcloud-guest.sh',
344
344
  'echo "[Unit]" >> /etc/systemd/system/testcloud.service',
345
345
  'echo "Description=Testcloud guest integration" >> /etc/systemd/system/testcloud.service',
346
346
  'echo "After=cloud-init.service" >> /etc/systemd/system/testcloud.service',
347
347
  'echo "[Service]" >> /etc/systemd/system/testcloud.service',
348
- 'echo "ExecStart=/bin/bash /opt/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service',
348
+ 'echo "ExecStart=/bin/bash /etc/testcloud-guest.sh" >> /etc/systemd/system/testcloud.service',
349
349
  'echo "[Install]" >> /etc/systemd/system/testcloud.service',
350
350
  'echo "WantedBy=multi-user.target" >> /etc/systemd/system/testcloud.service',
351
351
  'systemctl daemon-reload',
@@ -138,7 +138,7 @@ def get_image_url(distro_str: str, arch="x86_64", verify=False, additional_handl
138
138
  "centos-stream": {"re": r"^c(entos-stream)?(-|:)?(\d+)?$", "fn": get_centos_stream_image_url},
139
139
  "coreos": {"re": r"^co(reos)?(-|:)?(%s)?$" % COREOS, "fn": get_coreos_image_url},
140
140
  "centos": {"re": r"^c(entos)?(-|:)?(\d+)?$", "fn": get_centos_image_url},
141
- "ubuntu": {"re": r"^u(buntu)?(-|:)?(\d+)?$", "fn": get_ubuntu_image_url},
141
+ "ubuntu": {"re": r"^u(buntu)?([:-]([a-z]+|\d+))?$", "fn": get_ubuntu_image_url},
142
142
  "debian": {"re": r"^d(ebian)?(-|:)?(\d+)?$", "fn": get_debian_image_url},
143
143
  "alma": {"re": r"^a(lma)?(-|:)?(\d+)?$", "fn": get_alma_image_url},
144
144
  "rocky": {"re": r"^r(ocky)?(-|:)?(\d+)?$", "fn": get_rocky_image_url},
@@ -158,7 +158,7 @@ def get_image_url(distro_str: str, arch="x86_64", verify=False, additional_handl
158
158
  if match:
159
159
  return (verify_url if verify else lambda x: x)(distro["fn"](version=match.group(3) or "latest", arch=arch))
160
160
 
161
- log.error("Invalid url handle (distro or distro-version) passed, supported handles are: %s" % HELP_LIST)
161
+ log.error("Invalid url handle (distro or distro{-,:}version) passed, supported handles are: %s" % HELP_LIST)
162
162
  raise exceptions.TestcloudImageError
163
163
 
164
164
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: testcloud
3
- Version: 0.11.3
3
+ Version: 0.11.4
4
4
  Summary: A tool to download and boot cloud images locally, with an easy to use API.
5
5
  Home-page: https://pagure.io/testcloud
6
6
  Author: Mike Ruckman
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes