1
0
mirror of https://github.com/projectatomic/atomic.git synced 2026-02-06 12:45:57 +01:00
Files
atomic/tests/integration/test_params.sh
Brent Baude c7aafb3314 Refactor Pull, Update, Install, Run
Refactor several of the atomic verbs and subverbs to take advantage
of object refactoring.

Also, do not pull images with skopeo if the local image is already
at the latest.

$ sudo python ./atomic --debug pull busybox
Namespace(_class=<class 'Atomic.pull.Pull'>, assumeyes=False, debug=True, func='pull_image', image='busybox', reg_type=None, storage='docker')
Latest version of busybox already present.

Closes: #825
Approved by: baude
2017-01-17 22:16:36 +00:00

40 lines
1019 B
Bash
Executable File

#!/bin/bash -x
set -euo pipefail
IFS=$'\n\t'
ATOMIC=$(grep -v -- --debug <<< "$ATOMIC")
test() {
expected=$(for i in $@; do echo $i; done)
output=$(${ATOMIC} install atomic-test-6 $@ | grep -v docker)
if [[ "${expected}" != "${output}" ]]; then
# Test failed
echo "Test Failed"
echo ${expected}
echo "!= "
echo ${output}
exit 1
fi
}
# Test scripts run with PWD=tests/..
# The test harness exports some variables into the environment during
# testing: PYTHONPATH (python module import path
# WORK_DIR (a directory that is safe to modify)
# DOCKER (the docker executable location)
# ATOMIC (an invocation of 'atomic' which measures code coverage)
# SECRET (a generated sha256 hash inserted into test containers)
# In addition, the test harness creates some images for use in testing.
# See tests/test-images/
OUTPUT=$(/bin/true)
rc=0
# Test different values
test 'asdf&jkl'
test 'bash -c "echo arg1 arg2"'
test ježek 'asdf jkl'