Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2pSxSi6xkrhmCITaESe99k3oPRuqeiCDJnamWQTdGuU=; b=pBdGK+UyBVmXZpq4sJwbZDcJ0A//NJpVPEad+FbDvWU/GG+TwicGaV4atrNnW03ytg sO/5l/ekEXoPJEj/vk2B25fStVLMjOH6wtC6/QdG607A/ptbPyTLqdsb9BPgG9O4cclY Z4ppaCNPZ3ISi0kxb6cE5GRx9T521guHhg6ZEeZckGbg77UKvJTtPPPyRJa6/CTWP3iV jAJl8oHtQqpjU828oe5eEUcJxmsMrNw4GbQmRYGafAAIDqr3hxUMduPoGyVHgzIM3H76 yO1Ao4SFF4LoQstRU7/ikCjY1KOK8LIpD8EbXLsqhiZNwAU9zJvZI0FA5kaG4saJtGad sGyQ== From: Guilherme Campos Camargo Date: Mon, 5 Mar 2018 19:39:01 -0300 Message-Id: <20180305223901.3250-3-guicc@profusion.mobi> In-Reply-To: <20180305223901.3250-1-guicc@profusion.mobi> References: <20180305223901.3250-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 2/2] Install Fuego Release Test dependencies and add fuego-test board List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org A new session has been added to the Dockerfile, mainly responsible for installing the Docker binary, pexpect and seleniumHQ (that are needed for Fuego to test a new Fuego release). Also, a fuego-test board (a simple loopback that points to localhost) has been added. The create scripts have also been modified to allow mapping the hosts' dockerd socket into the container. By doing this we allow Fuego and the host to share the same docker daemon. --- Dockerfile | 48 ++++++++++++++++++++++ fuego-host-scripts/docker-create-container.sh | 1 + .../docker-create-usb-privileged-container.sh | 1 + fuego-ro/boards/fuego-test.board | 13 ++++++ 4 files changed, 63 insertions(+) create mode 100644 fuego-ro/boards/fuego-test.board diff --git a/Dockerfile b/Dockerfile index aa52fd8..42b2fc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,6 +106,54 @@ RUN curl -L -O ${JENKINS_URL} && \ dpkg -i jenkins_${JENKINS_VERSION}_all.deb && \ rm jenkins_${JENKINS_VERSION}_all.deb + +# ============================================================================== +# Install Fuego Release Test Dependencies +# ============================================================================== + +# TODO: This session should be moved to a separate Dockerfile in the future, +# that simply extends a fuego-base image and compiles a Fuego that's capable of +# testing itself. + +# Install Dependencies +RUN apt-get update && \ + apt-get -yV install \ + apt-transport-https \ + ca-certificates \ + chromium \ + curl \ + gnupg2 \ + python3 \ + python3-pip \ + software-properties-common && \ + pip3 install \ + docker \ + pexpect \ + selenium + +# Install Docker +RUN curl -fsSL https://download.docker.com/linux/$(source /etc/os-release; \ + echo "$ID")/gpg | sudo apt-key add - && \ + add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/$(\ + source /etc/os-release; echo "$ID") $(lsb_release -cs) stable" && \ + apt-get update && \ + apt-get -yV install \ + docker-ce + +# Install Chrome Driver for SeleniumHQ +RUN CHROME_DRIVER_VERSION=$(curl --silent --fail \ + https://chromedriver.storage.googleapis.com/LATEST_RELEASE) && \ + curl https://chromedriver.storage.googleapis.com/$(\ + echo ${CHROME_DRIVER_VERSION})/chromedriver_linux64.zip \ + -o chrome-driver.zip && \ + unzip chrome-driver.zip -d /usr/local/bin && rm chrome-driver.zip && \ + chmod +x /usr/local/bin/chromedriver + +# Setting jenkins as a sudoer. Needed for accessing the dockerd socket. +RUN echo "jenkins ALL = (root) NOPASSWD:ALL" >> /etc/sudoers + + # ============================================================================== # Post installation # ============================================================================== diff --git a/fuego-host-scripts/docker-create-container.sh b/fuego-host-scripts/docker-create-container.sh index 3d133bd..e837614 100755 --- a/fuego-host-scripts/docker-create-container.sh +++ b/fuego-host-scripts/docker-create-container.sh @@ -29,6 +29,7 @@ sed -i "s/docker_jenkins_uid=1000/docker_jenkins_uid=$uid/" $DIR/../fuego-ro/con sed -i "s/docker_jenkins_gid=500/docker_jenkins_gid=$gid/" $DIR/../fuego-ro/conf/fuego.conf sudo docker create -it --name ${DOCKERCONTAINER} \ + -v /var/run/docker.sock:/var/run/docker.sock \ -v /boot:/boot:ro \ -v $DIR/../fuego-rw:/fuego-rw \ -v $DIR/../fuego-ro:/fuego-ro:ro \ diff --git a/fuego-host-scripts/docker-create-usb-privileged-container.sh b/fuego-host-scripts/docker-create-usb-privileged-container.sh index b314160..2329cbf 100755 --- a/fuego-host-scripts/docker-create-usb-privileged-container.sh +++ b/fuego-host-scripts/docker-create-usb-privileged-container.sh @@ -30,6 +30,7 @@ sed -i "s/docker_jenkins_gid=500/docker_jenkins_gid=$gid/" $DIR/../fuego-ro/conf sudo docker create -it --name ${DOCKERCONTAINER} \ --privileged \ + -v /var/run/docker.sock:/var/run/docker.sock \ -v /boot:/boot:ro \ -v /dev/bus/usb:/dev/bus/usb \ -v /dev/ttyACM0:/dev/ttyACM0 \ diff --git a/fuego-ro/boards/fuego-test.board b/fuego-ro/boards/fuego-test.board new file mode 100644 index 0000000..185e0b4 --- /dev/null +++ b/fuego-ro/boards/fuego-test.board @@ -0,0 +1,13 @@ +inherit "base-board" +include "base-params" + +IPADDR=127.0.0.1 +SRV_IP=127.0.0.1 +#LOGIN="root" +#PASSWORD="root" +#SSH_KEY="path/to/id_rsa" +BOARD_TESTDIR="$FUEGO_RW/tests" +PLATFORM="x86_64" +TRANSPORT="local" +ARCHITECTURE="x86_64" +DISTRIB="nosyslogd.dist" -- 2.16.2