Commit ea075f45 authored by Hilal Ozdemir's avatar Hilal Ozdemir

test/bats: remove python commands and use beiran installed with setuptools

parent cf735609
#!/usr/bin/env bats
@test "pulling an image from another node (with '--no-progress' option) exits peacefully" {
run python -m beiran docker image pull alpine --no-progress
run beiran docker image pull alpine --no-progress
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image (with '--no-progress' option) exits with error code" {
run python -m beiran docker image pull a_non_existent_image --no-progress
run beiran docker image pull a_non_existent_image --no-progress
[ "$status" -eq 1 ]
}
@test "pulling an image with docker image manifest v2 schema 1 from origin exists peacefully" {
run python -m beiran docker image pull alpine:2.7
run beiran docker image pull alpine:2.7
[ "$status" -eq 0 ]
}
\ No newline at end of file
#!/usr/bin/env bats
@test "pulling an image from another node (with '--wait' and '--no-progress' options) exits peacefully" {
run python -m beiran docker image pull alpine --wait --no-progress
run beiran docker image pull alpine --wait --no-progress
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image (with '--wait' and '--no-progress' options) exits with error code" {
run python -m beiran docker image pull a_non_existent_image --wait --no-progress
run beiran docker image pull a_non_existent_image --wait --no-progress
[ "$status" -eq 1 ]
}
#!/usr/bin/env bats
@test "pulling an image from another node exits peacefully" {
run python -m beiran docker image pull alpine
run beiran docker image pull alpine
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image exits with error code" {
run python -m beiran docker image pull a_non_existent_image
run beiran docker image pull a_non_existent_image
[ "$status" -eq 1 ]
}
#!/usr/bin/env bats
@test "pulling an image from a specific node (with '--from' option) exits peacefully" {
current_node_uuid="$(python -m beiran.cli node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
current_node_uuid="$(beiran node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
if [ "$current_node_uuid" -eq "$another_node_uuid" ]
then
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
fi
run python -m beiran docker image pull alpine --from $another_node_uuid
run beiran docker image pull alpine --from $another_node_uuid
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image from a specific node (with '--from' option) exits with error code" {
current_node_uuid="$(python -m beiran.cli node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
current_node_uuid="$(beiran node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
if [ "$current_node_uuid" -eq "$another_node_uuid" ]
then
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
fi
run python -m beiran docker image pull a_non_existent_image --from $another_node_uuid
run beiran docker image pull a_non_existent_image --from $another_node_uuid
[ "$status" -eq 1 ]
}
\ No newline at end of file
#!/usr/bin/env bats
@test "pulling an image from another node (with '--whole-image-only' option) exits peacefully" {
run python -m beiran docker image pull alpine --whole-image-only
run beiran docker image pull alpine --whole-image-only
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image (with '--whole-image-only' option) exits with error code" {
run python -m beiran docker image pull a_non_existent_image --whole-image-only
run beiran docker image pull a_non_existent_image --whole-image-only
[ "$status" -eq 1 ]
}
@test "pulling an image from a specific node (with '--whole-image-only' and '--from' options) exits peacefully" {
current_node_uuid="$(python -m beiran.cli node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
current_node_uuid="$(beiran node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
if [ "$current_node_uuid" == "$another_node_uuid" ]
then
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
fi
run python -m beiran docker image pull alpine --whole-image-only --from $another_node_uuid
run beiran docker image pull alpine --whole-image-only --from $another_node_uuid
[ "$status" -eq 0 ]
}
@test "pulling a non-existing image from a specific node (with '--whole-image-only' and '--from' options) exits with error code" {
current_node_uuid="$(python -m beiran.cli node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
current_node_uuid="$(beiran node info | tail -1 | awk '{print $2}' | cut -d "#" -f 2)"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '1q;d')"
if [ "$current_node_uuid" == "$another_node_uuid" ]
then
another_node_uuid="$(python -m beiran.cli node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
another_node_uuid="$(beiran node list | cut -d ' ' -f1 | grep -x '[_[:alnum:]]\{32\}' | sed '2q;d')"
fi
run python -m beiran docker image pull a_non_existent_image --whole-image-only --from $another_node_uuid
run beiran docker image pull a_non_existent_image --whole-image-only --from $another_node_uuid
[ "$status" -eq 1 ]
}
@test "pulling an image with docker image manifest v2 schema 1 from another node exists peacefully" {
run python -m beiran docker image pull alpine:2.7
run beiran docker image pull alpine:2.7
[ "$status" -eq 0 ]
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment