Exemplo n.º 1
0
def test_from_ubuntu_20_04_pkg_latest():
    cmd = f"build --from=ubuntu:20.04 --with-kubectl=latest --with-velero=latest"
    image_id = common.cli(cmd)
    assert len(image_id) == 12

    docker_run_output = common.docker_run(
        image_id, "kubectl version --client=true --output=json"
    )
    docker_run_output = json.loads(docker_run_output)

    assert "gitVersion" in docker_run_output["clientVersion"]

    docker_run_output = common.docker_run(image_id, "velero version --client-only")

    assert "Git commit:" in docker_run_output
Exemplo n.º 2
0
def test_from_ubuntu_20_04_pkg_version():
    kubectl_version = "1.17.0"
    velero_version = "1.5.2"
    cmd = f"build --from=ubuntu:20.04 --with-kubectl={kubectl_version} --with-velero={velero_version}"
    image_id = common.cli(cmd)
    assert len(image_id) == 12

    docker_run_output = common.docker_run(
        image_id, "kubectl version --client=true --output=json"
    )
    docker_run_output = json.loads(docker_run_output)

    f"v{kubectl_version}" == docker_run_output["clientVersion"]["gitVersion"]

    docker_run_output = common.docker_run(image_id, "velero version --client-only")

    assert f"Version: v{velero_version}" in docker_run_output
Exemplo n.º 3
0
def test_from_ubuntu_20_04_pkg_1_15_0():
    pkg_version = "1.15.0"
    cmd = f"build --from=ubuntu:18.04 --with-kubectl={pkg_version}"
    image_id = common.cli(cmd)
    assert len(image_id) == 12

    docker_run_output = common.docker_run(
        image_id, "kubectl version --client=true --output=json")
    docker_run_output = json.loads(docker_run_output)

    f"v{pkg_version}" == docker_run_output["clientVersion"]["gitVersion"]
Exemplo n.º 4
0
def test_from_ubuntu20_04_pkg_latest():

    from_ = "ubuntu:20.04"
    pkg_version = "latest"
    pkg_version_assert = None

    cmd = f"build --from={from_} --with-azurecli={pkg_version}"
    image_id = common.cli(cmd)
    assert len(image_id) == 12

    docker_run_output = common.docker_run(image_id, "az version --output=json")

    assert "azure-cli" in docker_run_output
Exemplo n.º 5
0
def test_from_ubuntu20_04_pkg_2_14_2():

    from_ = "ubuntu:20.04"
    pkg_version = "2.14.2"

    cmd = f'build --from={from_} --apt=python3-pip --pip3="azure-cli=={pkg_version}"'

    image_id = common.cli(cmd)
    assert len(image_id) == 12

    docker_run_output = common.docker_run(image_id, "az version --output=json")
    docker_run_output = json.loads(docker_run_output)

    assert pkg_version == docker_run_output["azure-cli"]