-
-
Notifications
You must be signed in to change notification settings - Fork 650
"cobbler buildiso": Prevent image based systems from being processed #3237
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cb1f527
Docs: Clarify "cobbler buildiso --systems" parameter
SchoolGuy 8ec27e4
Tests: Modify case for "filter_systems" in "cobbler buildiso"
SchoolGuy 9b802db
Buildiso: Fix NoneTypeError for --systems
SchoolGuy 7919983
Tests: Remove cleanup bug
SchoolGuy e081227
Tests: Fix not idempotent image tests
SchoolGuy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,115 +1,92 @@ | ||
import pytest | ||
|
||
# TODO: Create fixture where image is create | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def remove_item(remote, token): | ||
""" | ||
Remove an item with the given name. | ||
|
||
:param token: The fixture to have the token for authenticated strings available. | ||
:param remote: The fixture to have the base xmlrpc connection. | ||
""" | ||
|
||
def _remove_item(itemtype, name): | ||
yield | ||
remote.remove_item(itemtype, name, token) | ||
|
||
return _remove_item | ||
|
||
|
||
class TestImage: | ||
def test_create_image(self, remote, token): | ||
""" | ||
Test: create/edit of an image object""" | ||
|
||
# Arrange | ||
|
||
Test: create/edit of an image object | ||
""" | ||
# Act | ||
images = remote.get_images(token) | ||
image = remote.new_image(token) | ||
|
||
# Assert | ||
assert remote.modify_image(image, "name", "testimage0", token) | ||
assert remote.save_image(image, token) | ||
new_images = remote.get_images(token) | ||
assert len(new_images) == len(images) + 1 | ||
image_list = remote.get_images(token) | ||
assert len(image_list) == 1 | ||
|
||
def test_get_images(self, remote): | ||
""" | ||
Test: get images | ||
""" | ||
|
||
# Arrange | ||
|
||
# Act | ||
remote.get_images() | ||
|
||
# Assert | ||
|
||
def test_get_image(self, remote): | ||
def test_get_image(self, remote, create_image): | ||
""" | ||
Test: Get an image object | ||
""" | ||
|
||
# Arrange | ||
test_image = create_image() | ||
|
||
# Act | ||
result_image = remote.get_image(test_image.name) | ||
|
||
# Assert | ||
image = remote.get_image("testimage0") | ||
assert result_image.get("name") == test_image.name | ||
|
||
def test_find_image(self, remote, token): | ||
def test_find_image(self, remote, token, create_image): | ||
""" | ||
Test: Find an image object | ||
""" | ||
|
||
# Arrange | ||
test_image = create_image() | ||
|
||
# Act | ||
result = remote.find_image({"name": "testimage0"}, token) | ||
result = remote.find_image({"name": test_image.name}, token) | ||
|
||
# Assert | ||
assert result | ||
# Assert - We want to find exactly the one item we added | ||
assert len(result) == 1 | ||
assert result[0].get("name") == test_image.name | ||
|
||
def test_copy_image(self, remote, token): | ||
def test_copy_image(self, remote, token, create_image): | ||
""" | ||
Test: Copy an image object | ||
""" | ||
|
||
# Arrange | ||
test_image = create_image() | ||
new_name = "testimagecopy" | ||
|
||
# Act | ||
image = remote.get_item_handle("image", "testimage0") | ||
result = remote.copy_image(test_image.uid, new_name, token) | ||
|
||
# Assert | ||
assert remote.copy_image(image, "testimagecopy", token) | ||
assert result | ||
|
||
def test_rename_image(self, remote, token, remove_item): | ||
def test_rename_image(self, remote, token, create_image): | ||
""" | ||
Test: Rename an image object | ||
""" | ||
# Arrange | ||
name = "testimage1" | ||
image = remote.get_item_handle("image", "testimagecopy") | ||
test_image = create_image() | ||
new_name = "testimage_renamed" | ||
|
||
# Act | ||
result = remote.rename_image(image, name, token) | ||
|
||
# Cleanup | ||
remote.remove_item("image", name, token) | ||
result = remote.rename_image(test_image.uid, new_name, token) | ||
|
||
# Assert | ||
assert result | ||
|
||
def test_remove_image(self, remote, token): | ||
def test_remove_image(self, remote, token, create_image): | ||
""" | ||
Test: remove an image object | ||
""" | ||
# Arrange | ||
test_image = create_image() | ||
|
||
# Act | ||
result = remote.remove_image(test_image.name, token) | ||
|
||
# Assert | ||
assert remote.remove_image("testimage0", token) | ||
assert result |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.