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.
- {testcloud-0.11.3/testcloud.egg-info → testcloud-0.11.4}/PKG-INFO +1 -1
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/conf.py +1 -1
- {testcloud-0.11.3 → testcloud-0.11.4}/test/test_config.py +15 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/test/test_image.py +15 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/test/test_instance.py +16 -2
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/__init__.py +1 -1
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/ubuntu.py +1 -1
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/instance.py +3 -3
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/util.py +2 -2
- {testcloud-0.11.3 → testcloud-0.11.4/testcloud.egg-info}/PKG-INFO +1 -1
- {testcloud-0.11.3 → testcloud-0.11.4}/.gitignore +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/LICENSE +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/README.md +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/conf/99-testcloud-nonroot-libvirt-access.rules +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/conf/settings-example.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/conf/testcloud +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/LICENSE +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/Makefile +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/api.rst +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/indepth.rst +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/docs/source/index.rst +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/manpages/testcloud.1 +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/pyproject.toml +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/requirements.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/run_testcloud.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/setup.cfg +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/setup.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/test/__init__.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/test/test_cli.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/cli.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/config.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/__init__.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/alma.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/centos.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/debian.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/fedora.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/misc.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/oracle.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/distro_utils/rocky.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/domain_configuration.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/exceptions.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/image.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/sql.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud/workarounds.py +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/SOURCES.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/dependency_links.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/entry_points.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/requires.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/testcloud.egg-info/top_level.txt +0 -0
- {testcloud-0.11.3 → testcloud-0.11.4}/tox.ini +0 -0
|
@@ -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
|
|
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"
|
|
@@ -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 "
|
|
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}" >> /
|
|
343
|
-
'chmod +x /
|
|
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 /
|
|
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)?(
|
|
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
|
|
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
|
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|