rancher/smoketest

Name: smoketest

Owner: Rancher

Description: Basic pre-launch tests for running Rancher

Created: 2017-09-05 17:37:57.0

Updated: 2017-09-05 21:12:59.0

Pushed: 2017-09-05 19:58:57.0

Homepage: https://www.rancher.com

Size: 9

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Rancher Smoke Test

This is a script to perform basic tests for a Rancher Server or a Rancher Node.

The script provides options for tests of the Rancher Server and the Rancher Agent. Server tests are intended to be run from a Rancher Server node, and agent tests are intended to be run from a Rancher Agent node.

Usage
smoketest.sh --help

p using ./smoketest.sh

 --orchestrator  [arg] Orchestration engine [cattle|k8s|kubernetes] Required.
 --server      Run tests for Rancher Server
 --agent       Run tests for Rancher Agent
               Enable verbose mode, print script as it is executed
 --debug       Enables debug mode
 --help        This page
 --no-color    Disable color output

You can run tests for Rancher Server with --server and/or tests for Rancher Agent with --agent.

This script uses a logging level structure similar to syslog, where 1 is emergency and 7 is debug. It defaults to logging output at a log level of notice (5) and higher. You can change this by setting LOG_LEVEL before running the script:

G_LEVEL=7 ./smoketest.sh --help
Configuration

Core components are baked into the script. User-configurable components are set in smoketest.cfg as Bash variables. This file is optional, and if provided, will use the following variables:

Understanding Test Output
HTTP Checks

We're checking for reachability, so we accept anything from 200-499 as a response. Some sites return 401 or 405, which is still a valid response for this test.

Port Checks

Port checks are run between Rancher Agent nodes and require that you set RANCHER_AGENT_NODES in smoketest.cfg:

HER_AGENT_NODES=(
.22.12.199
.22.79.141

The ipsec overlay network uses 500/udp and 4500/udp. The vxlan overlay network uses 4789/udp. When scanning with nmap, we might not be able to tell if a port is actually open. Some things which are open show up as filtered because the process on the other side never sent a response. It's also possible that the packets were filtered by a firewall. We can, however, tell if it's closed.

The output from the port scan looks like this:

-09-05 18:48:11 UTC [   notice] ################################
-09-05 18:48:11 UTC [   notice] ## Port Checks (Overlay Network)
-09-05 18:48:11 UTC [   notice] ################################
-09-05 18:48:11 UTC [   notice] Checking 18.22.12.199
-09-05 18:48:12 UTC [  warning]   + 500/udp: CLOSED
-09-05 18:48:14 UTC [  warning]   + 4500/udp: FILTERED
-09-05 18:48:16 UTC [  warning]   + 4789/udp: FILTERED
-09-05 18:48:16 UTC [   notice] Checking 18.22.79.141
-09-05 18:48:17 UTC [   notice]   + 500/udp: OPEN
-09-05 18:48:19 UTC [  warning]   + 4500/udp: FILTERED
-09-05 18:48:19 UTC [  warning]   + 4789/udp: CLOSED

In this case the first node is probably correctly configured for vxlan, because 500/udp is closed. 4789/udp is filtered.

The second node is probably correctly configured for ipsec because 4789/udp is closed, and 500/udp is open.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.