Skip to content

Commit

Permalink
Add 'set -eu' for test script robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Mar 10, 2025
1 parent f7ba1cb commit c543512
Show file tree
Hide file tree
Showing 65 changed files with 66 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/scripts/pulp_2to3_migration/test_plan.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_2to3_migration/test_pulp2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_content.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_distribution.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_repository.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_sign.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_ansible/test_sync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_content.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_copy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_distribution.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_namespace.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_repository.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_role.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_sync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_container/test_tag.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_acs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_content.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_content_bulk.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_distribution.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_label.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_publication.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_repository.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_role.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_file/test_sync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_content.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_distribution.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_publication.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_repository.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_python/test_sync.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_acs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_comps.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_content.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
4 changes: 1 addition & 3 deletions tests/scripts/pulp_rpm/test_copy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# src1 src2 dest1 dest2 pkg advisory

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down Expand Up @@ -99,5 +99,3 @@ cat << EOF > ./cli_copy_test.json
]
EOF
expect_succ pulp rpm copy --config @./cli_copy_test.json


4 changes: 1 addition & 3 deletions tests/scripts/pulp_rpm/test_prune.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down Expand Up @@ -32,6 +33,3 @@ expect_succ pulp rpm prune-packages --repository "rpm:rpm:cli_test_rpm_prune" --
expect_succ pulp rpm prune-packages --repository "rpm:rpm:cli_test_rpm_prune" --repository "${repo_href}" --repository "${repo_href_2}" --dry-run
expect_succ pulp rpm prune-packages --all-repositories --dry-run
expect_succ pulp rpm prune-packages --repository "rpm:rpm:cli_test_rpm_prune" --keep-days 0



1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_rpm_sync_publish.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulp_rpm/test_uln_remote.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_access_policy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_artifact.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_cert_guards.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_content_guards.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_group.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_group_permissions.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_orphans.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_pulpexporter.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_pulpimporter.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_query_params.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/pulpcore/test_repository_reclaim_space.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down Expand Up @@ -32,4 +33,4 @@ test "$(echo "$OUTPUT" | jq -r '.[] | select(.relative_path | endswith("1.iso"))
# Reclaim disk space and verify that the artifact is no longer available
expect_succ pulp repository reclaim --repository "file:file:cli_test_reclaim_repo"
expect_succ pulp file repository content list --repository "cli_test_reclaim_repo" --version 1
test "$(echo "$OUTPUT" | jq -r '.[] | select(.relative_path | endswith("1.iso")) | .artifact')" = "null"
test "$(echo "$OUTPUT" | jq -r '.[] | select(.relative_path | endswith("1.iso")) | .artifact')" = "null"
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_rhsm_cert_guards.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
1 change: 1 addition & 0 deletions tests/scripts/pulpcore/test_role.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

set -eu
# shellcheck source=tests/scripts/config.source
. "$(dirname "$(dirname "$(realpath "$0")")")"/config.source

Expand Down
Loading

0 comments on commit c543512

Please sign in to comment.