<commit_before>#!/bin/sh
set -e

# Configuration
if [ ! -z "$S3_HOST" ]; then
  echo "Setting S3 host to $S3_HOST"
  sed -i -e "s@^host =.*@host = $S3_HOST@g" \
    /config
fi
if [ ! -z "$S3_PORT" ]; then
  echo "Setting S3 port to $S3_PORT"
  sed -i -e "s@^port =.*@port = $S3_PORT@g" \
    /config
fi

# Start tests
echo 'Starting s3-tests ...'
source s3-tests/virtualenv/bin/activate \
  && S3TEST_CONF=/config s3-tests/virtualenv/bin/nosetests "$@"<commit_msg>ceph-s3-tests: Add options<commit_after>#!/bin/sh
set -e

# Configuration
if [ ! -z "$S3_HOST" ]; then
  echo "Setting S3 host to $S3_HOST"
  sed -i -e "s@^host =.*@host = $S3_HOST@g" \
    /config
fi
if [ ! -z "$S3_PORT" ]; then
  echo "Setting S3 port to $S3_PORT"
  sed -i -e "s@^port =.*@port = $S3_PORT@g" \
    /config
fi
if [ ! -z "$S3_IS_SECURE" ]; then
  echo "Setting S3 port to $S3_IS_SECURE"
  sed -i -e "s@^is_secure =.*@is_secure = $S3_IS_SECURE@g" \
    /config
fi
if [ ! -z "$S3_BUCKET_PREFIX" ]; then
  echo "Setting bucket prefix to $S3_BUCKET_PREFIX"
  sed -i -e "s@^bucket prefix =.*@bucket prefix = $S3_BUCKET_PREFIX@g" \
    /config
fi
if [ ! -z "$S3_MAIN_DISPLAY_NAME" ]; then
  echo "Setting main display name to $S3_MAIN_DISPLAY_NAME"
  sed -i -e "s@^display_name = admin@display_name = $S3_MAIN_DISPLAY_NAME@g" \
    /config
fi
if [ ! -z "$S3_MAIN_ACCESS_KEY" ]; then
  echo "Setting main access key to $S3_MAIN_ACCESS_KEY"
  sed -i -e "s@^access_key = admin:admin@access_key = $S3_MAIN_ACCESS_KEY@g" \
    /config
fi
if [ ! -z "$S3_MAIN_SECRET_KEY" ]; then
  echo "Setting main secret key to $S3_MAIN_SECRET_KEY"
  sed -i -e "s@^secret_key = admin@secret_key = $S3_MAIN_SECRET_KEY@g" \
    /config
fi
if [ ! -z "$S3_ALT_DISPLAY_NAME" ]; then
  echo "Setting alt display name to $S3_ALT_DISPLAY_NAME"
  sed -i -e "s@^display_name = test2@display_name = $S3_ALT_DISPLAY_NAME@g" \
    /config
fi
if [ ! -z "$S3_ALT_ACCESS_KEY" ]; then
  echo "Setting alt access key to $S3_ALT_ACCESS_KEY"
  sed -i -e "s@^access_key = test:tester@access_key = $S3_ALT_ACCESS_KEY@g" \
    /config
fi
if [ ! -z "$S3_ALT_SECRET_KEY" ]; then
  echo "Setting alt secret key to $S3_ALT_SECRET_KEY"
  sed -i -e "s@^secret_key = testing@secret_key = $S3_ALT_SECRET_KEY@g" \
    /config
fi

# Start tests
echo 'Starting s3-tests ...'
source s3-tests/virtualenv/bin/activate \
  && S3TEST_CONF=/config s3-tests/virtualenv/bin/nosetests "$@"
{'fraction_non_alphanumeric': 0.15451895043731778, 'fraction_numerical': 0.0212411495210329, 'mean_word_length': 3.4897196261682244, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4792337', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1037, 'n_words': 252}