diff --git a/tests/README.md b/tests/README.md index 96d91f626d7bf..91fd8b6145817 100644 --- a/tests/README.md +++ b/tests/README.md @@ -39,9 +39,7 @@ installing dependencies and updates on every vm.): * Install ducktape: - $ git clone https://github.com/confluentinc/ducktape - $ cd ducktape - $ python setup.py install + $ pip install ducktape * Run the system tests using ducktape: @@ -93,9 +91,7 @@ the test driver machine. * Start by making sure you're up to date, and install git and ducktape: $ sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y git - $ git clone https://github.com/confluentinc/ducktape.git - $ cd ducktape - $ python setup.py install + $ pip install ducktape * Get Kafka: @@ -104,7 +100,7 @@ the test driver machine. * Install some dependencies: $ cd kafka - $ aws/aws-init.sh + $ kafka/vagrant/aws/aws-init.sh $ . ~/.bashrc * An example Vagrantfile.local has been created by aws-init.sh which looks something like: diff --git a/tests/aws/aws-access-keys-commands b/tests/aws/aws-access-keys-commands deleted file mode 100644 index d4aa263e89ad7..0000000000000 --- a/tests/aws/aws-access-keys-commands +++ /dev/null @@ -1,3 +0,0 @@ -export AWS_ACCESS_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep AccessKeyId | awk -F\" '{ print $4 }'` -export AWS_SECRET_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep SecretAccessKey | awk -F\" '{ print $4 }'` -export AWS_SESSION_TOKEN=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ducttape-master | grep Token | awk -F\" '{ print $4 }'` diff --git a/vagrant/aws/aws-access-keys-commands b/vagrant/aws/aws-access-keys-commands new file mode 100644 index 0000000000000..4607ec00ff747 --- /dev/null +++ b/vagrant/aws/aws-access-keys-commands @@ -0,0 +1,13 @@ +if [ -z "$AWS_IAM" ];then + echo "Warning: AWS_IAM is not set" +fi + +export AWS_ACCESS_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep AccessKeyId | awk -F\" '{ print $4 }'` +export AWS_SECRET_KEY=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep SecretAccessKey | awk -F\" '{ print $4 }'` +export AWS_SESSION_TOKEN=`curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/$AWS_IAM | grep Token | awk -F\" '{ print $4 }'` + +if [ -z "$AWS_ACCESS_KEY" ]; then + echo "Failed to populate environment variables AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_SESSION_TOKEN." + echo "AWS_IAM is currently $AWS_IAM. Double-check that this is correct. If not set, add this command to your .bashrc file:" + echo "export AWS_IAM= # put this into your ~/.bashrc" +fi diff --git a/tests/aws/aws-example-Vagrantfile.local b/vagrant/aws/aws-example-Vagrantfile.local similarity index 100% rename from tests/aws/aws-example-Vagrantfile.local rename to vagrant/aws/aws-example-Vagrantfile.local diff --git a/tests/aws/aws-init.sh b/vagrant/aws/aws-init.sh similarity index 87% rename from tests/aws/aws-init.sh rename to vagrant/aws/aws-init.sh index 027aa90748b79..f3c32c5495592 100755 --- a/tests/aws/aws-init.sh +++ b/vagrant/aws/aws-init.sh @@ -1,13 +1,13 @@ #!/bin/bash -# This script should be run once on your aws test driver machine before -# attempting to run any ducktape tests +# This script can be used to set up a driver machine on aws from which you will run tests +# or bring up your mini Kafka cluster. # Install dependencies -sudo apt-get install -y maven openjdk-6-jdk build-essential \ +sudo apt-get install -y maven openjdk-7-jdk build-essential \ ruby-dev zlib1g-dev realpath python-setuptools -base_dir=`dirname $0`/.. +base_dir=`dirname $0`/../.. if [ -z `which vagrant` ]; then echo "Installing vagrant..."