<commit_before>#!/bin/bash
set -x -e


if [[ $INSIDE_DOCKER -eq 1 ]]; then
    # will assume if running inside docker, you are testing with the docker-compose setup
    DOCKER_GATEWAY=$(/sbin/ip route|awk '/default/ { print $3 }')
    CLIENT_IP_PORT=$DOCKER_GATEWAY":8822"
    GATEWAY_IP_PORT=$DOCKER_GATEWAY":9080"

    # remove cached file and setup fakes3 hack
    find . -iname '*.pyc' -delete || true
    echo "${DOCKER_GATEWAY}" "mender-artifact-storage.localhost" | tee -a /etc/hosts >/dev/null
else
    # allows you to override the client ip when not using docker
    CLIENT_IP_PORT=${CLIENT_IP_PORT:-"127.0.0.1:8822"}
    GATEWAY_IP_PORT=${GATEWAY_IP_PORT:-"127.0.0.1:9080"}
fi

if [[ ! -f large_image.dat ]]; then
    dd if=/dev/zero of=large_image.dat bs=200M count=0 seek=1
fi

if [[ ! -f core-image-full-cmdline-vexpress-qemu.ext4 ]] || [[ "$INSIDE_DOCKER" -eq 1 ]] ; then
    echo "!! WARNING: core-image-file-cmdline-vexpress-qemu.ext4 was found in the current working directory, will download the latest !!"
    curl -o core-image-full-cmdline-vexpress-qemu.ext4 "https://s3-eu-west-1.amazonaws.com/yocto-integration-builds/latest/core-image-full-cmdline-vexpress-qemu.ext4"
fi

if [[ ! -f core-image-full-cmdline-vexpress-qemu-broken-network.ext4 ]]; then
    cp core-image-full-cmdline-vexpress-qemu.ext4 core-image-full-cmdline-vexpress-qemu-broken-network.ext4
    e2rm core-image-full-cmdline-vexpress-qemu-broken-network.ext4:/lib/systemd/systemd-networkd
fi

if [[ ! -f broken_image.dat ]]; then
    dd if=/dev/zero of=broken_image.dat bs=10M count=0 seek=1
fi

py.test -s --tb=short --runslow --gateway "${GATEWAY_IP_PORT}" --clients "${CLIENT_IP_PORT}" --verbose --junitxml=results.xml tests/{test_bootstrapping.py,test_basic_integration.py,test_image_update_failures.py,test_fault_tolerance.py}<commit_msg>Use images form stable S3 bucket for stable tests.<commit_after>#!/bin/bash
set -x -e


if [[ $INSIDE_DOCKER -eq 1 ]]; then
    # will assume if running inside docker, you are testing with the docker-compose setup
    DOCKER_GATEWAY=$(/sbin/ip route|awk '/default/ { print $3 }')
    CLIENT_IP_PORT=$DOCKER_GATEWAY":8822"
    GATEWAY_IP_PORT=$DOCKER_GATEWAY":9080"

    # remove cached file and setup fakes3 hack
    find . -iname '*.pyc' -delete || true
    echo "${DOCKER_GATEWAY}" "mender-artifact-storage.localhost" | tee -a /etc/hosts >/dev/null
else
    # allows you to override the client ip when not using docker
    CLIENT_IP_PORT=${CLIENT_IP_PORT:-"127.0.0.1:8822"}
    GATEWAY_IP_PORT=${GATEWAY_IP_PORT:-"127.0.0.1:9080"}
fi

if [[ ! -f large_image.dat ]]; then
    dd if=/dev/zero of=large_image.dat bs=200M count=0 seek=1
fi

if [[ ! -f core-image-full-cmdline-vexpress-qemu.ext4 ]] || [[ "$INSIDE_DOCKER" -eq 1 ]] ; then
    echo "!! WARNING: core-image-file-cmdline-vexpress-qemu.ext4 was found in the current working directory, will download the latest !!"
    curl -o core-image-full-cmdline-vexpress-qemu.ext4 "https://s3-eu-west-1.amazonaws.com/yocto-integration-stable/latest/core-image-full-cmdline-vexpress-qemu.ext4"
fi

if [[ ! -f core-image-full-cmdline-vexpress-qemu-broken-network.ext4 ]]; then
    cp core-image-full-cmdline-vexpress-qemu.ext4 core-image-full-cmdline-vexpress-qemu-broken-network.ext4
    e2rm core-image-full-cmdline-vexpress-qemu-broken-network.ext4:/lib/systemd/systemd-networkd
fi

if [[ ! -f broken_image.dat ]]; then
    dd if=/dev/zero of=broken_image.dat bs=10M count=0 seek=1
fi

py.test -s --tb=short --runslow --gateway "${GATEWAY_IP_PORT}" --clients "${CLIENT_IP_PORT}" --verbose --junitxml=results.xml tests/{test_bootstrapping.py,test_basic_integration.py,test_image_update_failures.py,test_fault_tolerance.py}
{'fraction_non_alphanumeric': 0.14671710348554445, 'fraction_numerical': 0.02837071061875169, 'mean_word_length': 4.0027027027027025, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5122629', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1413, 'n_words': 271}