Skip to content

Commit

Permalink
e2e tests for eds tjobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sro committed Jan 18, 2018
0 parents commit 63c8a87
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
42 changes: 42 additions & 0 deletions DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM python:2.7-slim

#RUN mkdir -p /home/elastest/eds/eds-e2e

WORKDIR /app

# Copy the current directory contents into the container at /app
ADD . /app


# install packages and clean up
RUN printf "Starting update...\n" && \
apt-get update -qq && \
printf "Update finished.\n" && \
printf "Starting dist-upgrade...\n" && \
apt-get dist-upgrade -y > /dev/null && \
printf "Upgrade finished.\n" && \
printf "Starting install...\n" && \
apt-get install -y \
curl \
build-essential \
netbase \
iproute2 \
python-pip \
python-dev \
libev-dev \
gcc \
make \
automake \
jq > /dev/null && \
apt-get clean && \
printf "Installation and cleanup finished.\n"



# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 7070

CMD ["python"]
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
selenium
requests
setuptools
13 changes: 13 additions & 0 deletions tjobs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import unittest
import requests
import os


class TJob(unittest.TestCase):
# proxyurl="http://" + os.environ['ET_SUT_HOST'] + ":8080/"
print "Value of the Environment variable ET_EUS_API is:" + os.environ['JAVA_HOME']
print "Value of the Environment variable ET_ETM_API is:" + os.environ['ET_ETM_API']


if __name__ == "__main__":
unittest.main()
21 changes: 21 additions & 0 deletions tjobs_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import unittest
import requests
import os
import sys


class TJob():
proxyurl = "http://" + str(sys.argv[1]) + ":8080/"
proxies = {'http': proxyurl, 'https': proxyurl}

def test_send_request(self):
s = requests.Session()
response = s.get('http://www.elastest.io/', proxies=self.proxies, verify=False)
# response=s.get('http://etm:8091/')
print response.headers
assert "Elastest" in response.text


if __name__ == "__main__":
tjob = TJob()
tjob.test_send_request()

0 comments on commit 63c8a87

Please sign in to comment.