svn commit: r263786 - in user/jmmv/autotest/node: . configs

Julio Merino jmmv at FreeBSD.org
Thu Mar 27 01:27:58 UTC 2014


Author: jmmv
Date: Thu Mar 27 01:27:57 2014
New Revision: 263786
URL: http://svnweb.freebsd.org/changeset/base/263786

Log:
  Add nginx configuration.
  
  Set up nginx in the same way in all cluster machines and install the same
  static files.
  
  While doing this, remove a spurious comment that sneaked in in the last
  change that prevented autotest_node from being started.

Added:
  user/jmmv/autotest/node/configs/index.html   (contents, props changed)
  user/jmmv/autotest/node/configs/nginx.conf   (contents, props changed)
Modified:
  user/jmmv/autotest/node/setup.sh

Added: user/jmmv/autotest/node/configs/index.html
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jmmv/autotest/node/configs/index.html	Thu Mar 27 01:27:57 2014	(r263786)
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<title>FreeBSD test suite results</title>
+
+<style type="text/css">
+body {
+    font-family: arial;
+}
+table {
+    border-collapse: collapse;
+}
+table, th, td {
+    border: 1px solid black;
+    padding: 5px;
+}
+</style>
+
+</head>
+
+<body>
+<h1>FreeBSD test suite results</h1>
+
+<p>Welcome to the FreeBSD test cluster!</p>
+
+<p>Please excuse the current simplistic view of the test results.  Work is
+ongoing to provide you with better access to historical data as well as further
+details on the execution environment of each run.  At the moment, these pages
+are generated by <a
+href="http://svnweb.freebsd.org/base/user/jmmv/autotest/">ad-hoc scripts</a>
+and the goal is for Kyua to do everything by itself.  Bear with us in the
+meantime; it's a SMOP, but a significant one!</p>
+
+<p>Please see the <a href="http://wiki.freebsd.org/TestSuite">FreeBSD Test
+Suite project page</a> for more details.</p>
+
+<p>If you have any questions or suggestions regarding the contents of this page
+do not hesitate to contact the <a
+href="http://lists.freebsd.org/mailman/listinfo/freebsd-testing">freebsd-testing</a>
+mailing list.</p>
+
+<table>
+<thead>
+<tr>
+<th><b>Architecture</b></th>
+<th><b>Release</b></th>
+<th><b>Latest results</b></th>
+<th><b>Latest raw output</b></th>
+<th><b>All historical data</b></th>
+</tr>
+</thead>
+
+<tbody>
+<tr>
+<td>amd64</td>
+<td>HEAD</td>
+<td><a href="http://kyua1.nyi.freebsd.org/head/data/0-LATEST/results/index.html">HTML</a></td>
+<td><a href="http://kyua1.nyi.freebsd.org/head/data/0-LATEST/">Directory listing</a></td>
+<td><a href="http://kyua1.nyi.freebsd.org/head/data/">Directory listing</a></td>
+</tr>
+
+<tr>
+<td>amd64</td>
+<td>stable/10</td>
+<td><a href="http://kyua1.nyi.freebsd.org/stable-10/data/0-LATEST/results/index.html">HTML</a></td>
+<td><a href="http://kyua1.nyi.freebsd.org/stable-10/data/0-LATEST/">Directory listing</a></td>
+<td><a href="http://kyua1.nyi.freebsd.org/stable-10/data/">Directory listing</a></td>
+</tr>
+
+<tr>
+<td>i386</td>
+<td>HEAD</td>
+<td><a href="http://kyua2.nyi.freebsd.org/head/data/0-LATEST/results/index.html">HTML</a></td>
+<td><a href="http://kyua2.nyi.freebsd.org/head/data/0-LATEST/">Directory listing</a></td>
+<td><a href="http://kyua2.nyi.freebsd.org/head/data/">Directory listing</a></td>
+</tr>
+
+<tr>
+<td>i386</td>
+<td>stable/10</td>
+<td><a href="http://kyua2.nyi.freebsd.org/stable-10/data/0-LATEST/results/index.html">HTML</a></td>
+<td><a href="http://kyua2.nyi.freebsd.org/stable-10/data/0-LATEST/">Directory listing</a></td>
+<td><a href="http://kyua2.nyi.freebsd.org/stable-10/data/">Directory listing</a></td>
+</tr>
+</tbody>
+</table>
+
+<p>Note: If the "Latest results" link is broken, it is likely that the release
+build failed.  Click on the "Directory listing" for the "Latest raw output"
+instead to investigate what happened.</p>
+
+</body>
+</html>

Added: user/jmmv/autotest/node/configs/nginx.conf
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/jmmv/autotest/node/configs/nginx.conf	Thu Mar 27 01:27:57 2014	(r263786)
@@ -0,0 +1,44 @@
+worker_processes  1;
+
+events {
+    worker_connections  1024;
+}
+
+http {
+    include       mime.types;
+    types {
+        text/plain log;
+    }
+    default_type  application/octet-stream;
+
+    sendfile        on;
+
+    keepalive_timeout  65;
+
+    server {
+        listen       80;
+        server_name  localhost;
+
+        location / {
+            root   /kyua/www;
+            index  index.html index.htm;
+        }
+
+        location ^~ /head/data/ {
+            root /kyua;
+            index  index.html index.htm;
+            autoindex on;
+        }
+
+        location ^~ /stable-10/data/ {
+            root /kyua;
+            index  index.html index.htm;
+            autoindex on;
+        }
+
+        error_page   500 502 503 504  /50x.html;
+        location = /50x.html {
+            root   /usr/local/www/nginx-dist;
+        }
+    }
+}

Modified: user/jmmv/autotest/node/setup.sh
==============================================================================
--- user/jmmv/autotest/node/setup.sh	Thu Mar 27 01:18:58 2014	(r263785)
+++ user/jmmv/autotest/node/setup.sh	Thu Mar 27 01:27:57 2014	(r263786)
@@ -52,7 +52,7 @@ SETUP_CONFIG_VARS="ATF_REMOTE ATF_REVISI
 
 
 # Packages needed to bootstrap autotest.
-PACKAGES="automake autoconf kyua libtool qemu-devel"
+PACKAGES="automake autoconf kyua libtool nginx qemu-devel"
 
 
 # Sets defaults for configuration variables and hooks that need to exist.
@@ -72,6 +72,25 @@ setup_set_defaults() {
 }
 
 
+# Locates a source configuration file for this host and prints its path.
+#
+# \param name Name of the configuration file to locate.
+configfile() {
+    local name="${1}"; shift
+
+    local candidates=
+    candidates="${candidates} ${SETUP_ETCDIR}/${name}"
+    candidates="${candidates} ${SETUP_ETCDIR}/../${name}"
+
+    for candidate in ${candidates}; do
+        if [ -f "${candidate}" ]; then
+            echo "${candidate}"
+            return
+        fi
+    done
+}
+
+
 # Prints the source directory of a specific component.
 #
 # \param component Name of the source component.
@@ -178,7 +197,28 @@ setup_enable_daemon() {
     grep "autotest_node_enable=yes" /etc/rc.conf \
         || echo "autotest_node_enable=yes" >>/etc/rc.conf
 
-    #"${dir}/rc.d/autotest_node" start
+    "${dir}/rc.d/autotest_node" start
+}
+
+
+# Configures, enables and starts nginx for the host, if desired.
+setup_setup_nginx() {
+    local conf="$(configfile nginx.conf)"
+    if [ -z "${conf}" ]; then
+        shtk_cli_log "No nginx.conf for host; web server not enabled"
+    else
+        cp "${conf}" /usr/local/etc/nginx/nginx.conf
+
+        local index="$(configfile index.html)"
+        if [ -n "${index}" ]; then
+            mkdir -p /kyua/www
+            cp "${index}" /kyua/www
+        fi
+
+        grep -E "nginx_enable=\"?[Yy][Ee][Ss]\"?" /etc/rc.conf \
+            || echo "nginx_enable=yes" >>/etc/rc.conf
+        /usr/local/etc/rc.d/nginx start
+    fi
 }
 
 
@@ -237,6 +277,7 @@ setup_all() {
     setup_sync_atf
     setup_sync_shtk
     setup_sync_autotest
+    setup_nginx
     setup_enable_daemon
     setup_enable_cron
 }
@@ -284,7 +325,7 @@ main() {
             "${function}" "${@}" || exit_code="${?}"
             ;;
 
-        enable-cron|enable-daemon|sync-atf|sync-autotest|sync-packages|sync-shtk)
+        enable-cron|enable-daemon|setup-nginx|sync-atf|sync-autotest|sync-packages|sync-shtk)
             shtk_bool_check "${expert_mode}" \
                 || shtk_cli_usage_error "Using ${command} requires expert" \
                 "mode; try passing -X"


More information about the svn-src-user mailing list