<commit_before>#!/bin/bash -x
set -euo pipefail
IFS=$'\n\t'

#
# 'atomic run --display' and 'atomic install --display' integration tests
# AUTHOR: <NAME> <somalley at redhat dot com>
#
ATOMIC=${ATOMIC:="/usr/bin/atomic"}
DOCKER=${DOCKER:="/usr/bin/docker"}

teardown () {
    ${DOCKER} rm TEST3 TEST4 2> /dev/null
}
trap teardown EXIT

# Remove the --user UID:GID
OUTPUT=`${ATOMIC} run --display -n TEST1 atomic-test-1 | sed 's/ --user [0-9]*:[0-9]* //' | xargs`
OUTPUT2="/usr/bin/docker run -t -v /var/log/TEST1:/var/log -v /var/lib/TEST1:/var/lib --name TEST1 atomic-test-1 echo I am the run label."
if [[ ${OUTPUT} != ${OUTPUT2} ]]; then
    exit 1
fi

OUTPUT=`${ATOMIC} install --display -n TEST2 atomic-test-1 | xargs`
OUTPUT2="/usr/bin/docker run -v /etc/TEST2:/etc -v /var/log/TEST2:/var/log -v /var/lib/TEST2:/var/lib --name TEST2 atomic-test-1 echo I am the install label."
if [[ ${OUTPUT} != ${OUTPUT2} ]]; then
    exit 1
fi

${ATOMIC} install -n TEST3 atomic-test-1
OUTPUT=`${DOCKER} logs TEST3 | tr -d '\r'`
if [[ ${OUTPUT} != "I am the install label." ]]; then
    exit 1
fi

${ATOMIC} run -n TEST4 atomic-test-1
OUTPUT=`${DOCKER} logs TEST4 | tr -d '\r'`
if [[ ${OUTPUT} != "I am the run label." ]]; then
    exit 1
fi

OUTPUT=`${ATOMIC} install --display -n TEST5 centos | xargs`
OUTPUT2='/usr/bin/docker run -t -i --rm --privileged -v /:/host --net=host --ipc=host --pid=host -e HOST=/host -e NAME=TEST5 -e IMAGE=centos -e CONFDIR=/host/etc/TEST5 -e LOGDIR=/host/var/log/TEST5 -e DATADIR=/host/var/lib/TEST5 --name TEST5 centos'
if [[ ${OUTPUT} != ${OUTPUT2} ]]; then
    exit 1
fi
<commit_msg>test_display.sh: tweak for images with no INSTALL label<commit_after>#!/bin/bash -x
set -euo pipefail
IFS=$'\n\t'

#
# 'atomic run --display' and 'atomic install --display' integration tests
# AUTHOR: <NAME> <<EMAIL>>
#
ATOMIC=${ATOMIC:="/usr/bin/atomic"}
DOCKER=${DOCKER:="/usr/bin/docker"}

teardown () {
    ${DOCKER} rm TEST3 TEST4 2> /dev/null
}
trap teardown EXIT

# Remove the --user UID:GID
OUTPUT=`${ATOMIC} run --display -n TEST1 atomic-test-1 | sed 's/ --user [0-9]*:[0-9]* //' | xargs`
OUTPUT2="/usr/bin/docker run -t -v /var/log/TEST1:/var/log -v /var/lib/TEST1:/var/lib --name TEST1 atomic-test-1 echo I am the run label."
if [[ ${OUTPUT} != ${OUTPUT2} ]]; then
    exit 1
fi

OUTPUT=`${ATOMIC} install --display -n TEST2 atomic-test-1 | xargs`
OUTPUT2="/usr/bin/docker run -v /etc/TEST2:/etc -v /var/log/TEST2:/var/log -v /var/lib/TEST2:/var/lib --name TEST2 atomic-test-1 echo I am the install label."
if [[ ${OUTPUT} != ${OUTPUT2} ]]; then
    exit 1
fi

${ATOMIC} install -n TEST3 atomic-test-1
OUTPUT=`${DOCKER} logs TEST3 | tr -d '\r'`
if [[ ${OUTPUT} != "I am the install label." ]]; then
    exit 1
fi

${ATOMIC} run -n TEST4 atomic-test-1
OUTPUT=`${DOCKER} logs TEST4 | tr -d '\r'`
if [[ ${OUTPUT} != "I am the run label." ]]; then
    exit 1
fi

# The centos image does not have an INSTALL label, so `atomic install` should be
# a noop.
OUTPUT=`${ATOMIC} install --display -n TEST5 centos | xargs`
if [[ -n ${OUTPUT} ]]; then
    exit 1
fi

{'fraction_non_alphanumeric': 0.1967479674796748, 'fraction_numerical': 0.025691056910569107, 'mean_word_length': 3.236914600550964, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '227106', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1205, 'n_words': 367}