#!/usr/bin/perl -w # # Copyright (C) Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # Framework for starting test servers. # Based on the type of server specified, check for port availability, remove # temporary files, start the server, and verify that the server is running. # If a server is specified, start it. Otherwise, start all servers for test. use strict; use Cwd; use Cwd 'abs_path'; use Getopt::Long; # Usage: # perl start.pl [--noclean] [--restart] [--port port] test [server [options]] # # --noclean Do not cleanup files in server directory. # # --restart Indicate that the server is being restarted, so get the # server to append output to an existing log file instead of # starting a new one. # # --port port Specify the default port being used by the server to answer # queries (default 5300). This script will interrogate the # server on this port to see if it is running. (Note: for # "named" nameservers, this can be overridden by the presence # of the file "named.port" in the server directory containing # the number of the query port.) # # test Name of the test directory. # # server Name of the server directory. This will be of the form # "nsN" or "ansN", where "N" is an integer between 1 and 8. # If not given, the script will start all the servers in the # test directory. # # options Alternate options for the server. # # NOTE: options must be specified with '-- "