forked from pulp/pulp-cli-deb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pulp#13 from ATIX-AG/components_and_architectures
Add --components and --architectures to remote command
- Loading branch information
Showing
6 changed files
with
164 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Added --component and --architecture flags to the remote command. |
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck source=tests/scripts/config.source | ||
. "$(dirname "$(dirname "$(realpath "$0")")")/config.source" | ||
|
||
ENTITIES_NAME="test_deb_remote" | ||
|
||
cleanup() { | ||
pulp deb remote destroy --name "${ENTITIES_NAME}" || true | ||
} | ||
trap cleanup EXIT | ||
|
||
# Fail to create some remotes: | ||
expect_fail pulp deb remote create --name "foo" --url "foo" --distribution "" | ||
expect_fail pulp deb remote create --name "foo" --url "foo" | ||
expect_fail pulp deb remote create --name "foo" --url "" --distribution "foo" | ||
expect_fail pulp deb remote create --name "foo" --distribution "foo" | ||
expect_fail pulp deb remote create --name "" --url "foo" --distribution "foo" | ||
expect_fail pulp deb remote create --url "foo" --distribution "foo" | ||
|
||
# Create and trivially update a remote: | ||
expect_succ pulp deb remote create --name "${ENTITIES_NAME}" \ | ||
--url "foo" \ | ||
--distribution "foo" \ | ||
--component "foo" \ | ||
--architecture "foo" | ||
|
||
assert "$(echo "$OUTPUT" | jq -r .url)" == "foo" | ||
assert "$(echo "$OUTPUT" | jq -r .distributions)" == "foo" | ||
assert "$(echo "$OUTPUT" | jq -r .components)" == "foo" | ||
assert "$(echo "$OUTPUT" | jq -r .architectures)" == "foo" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" | ||
|
||
# Try some possible modifications of the remote's distribution: | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --distribution "bar" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .distributions)" == "bar" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --distribution "bar" --distribution "baz" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .distributions)" == "bar baz" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --distribution "bar" --distribution "" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .distributions)" == "bar" | ||
expect_fail pulp deb remote update --name "${ENTITIES_NAME}" --distribution "" | ||
assert "${ERROUTPUT}" == 'Error: {"distributions":["This field may not be null."]}' | ||
|
||
# Try some possible modifications of the remote's components: | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --component "bar" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .components)" == "bar" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --component "bar" --component "baz" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .components)" == "bar baz" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --component "bar" --component "" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .components)" == "bar" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --component "" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .components)" == "null" | ||
|
||
# Try some possible modifications of the remote's architectures: | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --architecture "bar" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .architectures)" == "bar" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --architecture "bar" --architecture "baz" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .architectures)" == "bar baz" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --architecture "bar" --architecture "" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .architectures)" == "bar" | ||
expect_succ pulp deb remote update --name "${ENTITIES_NAME}" --architecture "" | ||
expect_succ pulp deb remote show --name "${ENTITIES_NAME}" | ||
assert "$(echo "$OUTPUT" | jq -r .architectures)" == "null" | ||
|
||
# Now destroy the remote | ||
expect_succ pulp deb remote destroy --name "${ENTITIES_NAME}" |
This file contains 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