File: runme.sh

package info (click to toggle)
ansible-core 2.19.0~beta6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,628 kB
  • sloc: python: 180,313; cs: 4,929; sh: 4,601; xml: 34; makefile: 21
file content (45 lines) | stat: -rwxr-xr-x 1,534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash

set -eu -o pipefail

function check_entry_points() {
    bin_dir="$(dirname "$(command -v pip)")"

    for bin in "${bin_dir}/ansible"*; do
        name="$(basename "${bin}")"

        entry_point="${name//ansible-/}"
        entry_point="${entry_point//ansible/adhoc}"

        echo "=== ${name} (${entry_point})=${bin} ==="

        if [ "${name}" == "ansible-test" ]; then
            "${bin}" --help | tee /dev/stderr | grep -Eo "^usage:\ ansible-test\ .*"
            python.py -m ansible "${entry_point}" --help | tee /dev/stderr | grep -Eo "^usage:\ ansible-test\ .*"
        else
            "${bin}" --version | tee /dev/stderr | grep -Eo "(^${name}\ \[core\ .*|executable location = ${bin}$)"
            python.py -m ansible "${entry_point}" --version | tee /dev/stderr | grep -Eo "(^${name}\ \[core\ .*|executable location = ${bin}$)"
        fi
    done
}

source virtualenv.sh
set +x
unset PYTHONPATH  # this causes the test to fail if it was started from an existing virtual environment

base_dir="$(dirname "$(dirname "$(dirname "$(dirname "${OUTPUT_DIR}")")")")"

# deps are already installed, using --no-deps to avoid re-installing them
pip_options=(--disable-pip-version-check --no-deps)

echo "==> check entry points using an editable install"

pip install -e "${base_dir}" "${pip_options[@]}"
check_entry_points
pip uninstall -y ansible-core

echo "==> check entry points using a normal install"

pip install "${base_dir}" "${pip_options[@]}"
check_entry_points
pip uninstall -y ansible-core