Jenkins CI

From Linux NFS

(Difference between revisions)
Jump to: navigation, search
 
(11 intermediate revisions not shown)
Line 1: Line 1:
 +
I'm going to skip over basic Jenkins usage to keep this document short.  You can look at http://www.jenkins-ci.org if you need help using the Jenkins java program.
-
== Jenkins Setup ==
 
-
Before doing anything, make sure the required environment variables are set
 
-
to correct values (see the section "Required Environment Variables" below).
 
 +
== Basic Setup ==
Begin by cloning the jenkins-nfs git repository:
Begin by cloning the jenkins-nfs git repository:
-
<pre>
 
-
git clone git://git.linux-nfs.org/projects/bjschuma/jenkins-nfs.git
 
-
</pre>
 
-
The cloned directory should be placed in a location exported by the NFS server
+
<pre>$ git clone git://git.linux-nfs.org/projects/bjschuma/jenkins-nfs.git</pre>
-
running on the host machine.  The full path up to and including this directory
+
-
is referred to as $NFS_WORKSPACE throughout this document and various scripts.
+
-
Once you have the latest version of the scripts, cd into
+
The cloned directory should be placed in a location exported by the NFS server running on the host machine. The full path up to and including this directory is referred to as $NFS_WORKSPACE throughout this document and various scripts.
-
$NFS_WORKSPACE/jenkins-nfs and run ./setup to download the Jenkins executable,
+
-
required plugins, and to configure the jenkins environment.  In addition, a
+
-
launcher script called start_jenkins will be placed in $NFS_WORKSPACE.  Jenkins
+
-
is then started by running $NFS_WORKSPACE/start_jenkins.
+
-
Before you can use Jenkins to test kernels, you must first configure a "default"
+
Once you have the latest version of the scripts, cd into $NFS_WORKSPACE and run:
-
server.  This is the server hosting the Jenkins installation, and will be used
+
-
to install kernels on the virtual machine clients.  To add the default server,
+
-
run the "Admin - Add Server" job and enter "default" for the "NAME" parameter.
+
-
You must also configure what tests to run and virtual machines to run them on.
+
<pre>$ ./setup.sh</pre>
-
See the sections below for instructions on how to do this.  Once everything is
+
-
configured, you can begin a new run by starting the job "Compile and Install".
+
 +
to download the Jenkins executable, required plugins, and to configure the Jenkins environment.  This includes creating a symlink in your home directory ~/.jenkins -> $NFS_WORKSPACE/jenkins.  When you are ready, run
-
== Required Environment Variables ==
+
<pre>$ ./start_jenkins</pre>
-
These need to be set before starting Jenkins
+
-
* NFS_SSH_USER
+
to start Jenkins and point your web browser to localhost:8080 to see the web gui.
-
** The username of the virtual machine user that will install the compiled kernel and run the tests.  SSH should be configured to avoid prompting for a password.
+
-
* NFS_MOUNT_POINT
+
-
** The path on the virtual machine that NFS_SERVER is mounted on.
+
 +
Use the "Admin - Add Client" and "Admin - Add Server" jobs on the "Admin" tab to set up machine profiles for testing.  Edit the "Run Clients" job to set your list of clients as possible values for the NFS_CLIENT field.  Edit the "Run Tests" job to set your list of servers as possible values for the NFS_SERVER field.
-
== Adding a new architecture ==
+
If you want to test the latest linux-next code from Trond's tree, run the "Linux NFS" job to check out and run the codeYou may want to change the default value for the SRC_DIR parameter so you don't have to enter the path all the time (and also because the job is currently configured for Bryan's setup...).
-
Jenkins is configured for i386 and x86_64 by default.  Other architectures can
+
-
be added, but manual configuration is required.  You will have to modify both
+
-
"Compile and Install" and "Run Tests".  Select each job from the dashboard and
+
-
then click "Configure" on the leftScroll down to the "Configuration Matrix"
+
-
and add the new architecture to the list of possible values for the ARCH
+
-
variable.
+
 +
You can also run the "Test Controller" job on the "Common" tab to test a kernel without updating it from git first.
-
== Adding a new .config ==
 
-
Copy the config file to $NFS_WORKSPACE/config/ using a unique name.  Then modify
 
-
"Compile and Install" and "Run Tests" to add the new file to the CONFIG variable
 
-
in the "Test Matrix".
 
 +
== config/nfsrc ==
 +
This is the basic configuration file used by the scripts in $NFS_WORKSPACE/nfs/ to set up a default environment.  Any changes here will not require you to restart Jenkins and should take effect almost immediately.
-
== Adding a new virtual machine client ==
+
;NFS_DEFAULT_SERVER
-
Create the new VM in virt-manager.  Once it has been created, start the
+
:This should be set to the name (see `nfs server init`) of the server used by the nfs* commands when no server is specifiedIn most cases you probably want to set this to the machine hosting Jenkins.
-
"Initialize VM" job to configure passwordless SSH to the VM and install various
+
-
tests (such as connectathon).  See the section "Virtual machine setup" below for
+
-
help creating new VMs.
+
 +
;NFS_DEFAULT_VERSION
 +
:This should be set to the NFS version used by clients when mounting $NFS_DEFAULT_SERVER.
-
== Adding a new server ==
+
;NFS_SOURCE_EXPORT
-
Set up the server (either as a VM or a real machine), and then run the "Add
+
:This should be set to the directory exported by the NFS server hosting the compiled Linux code.
-
Server" job to create a server config file.  When the job has finished, edit
+
-
"Run Tests" and add the server name to the SERVER variable of the "Test Matrix"
+
 +
;NFS_SOURCE_SERVER
 +
:This should be set to the machine hosting the compiled Linux code (most likely $NFS_DEFAULT_SERVER).
-
== Adding a new NFS version ==
+
;NFS_SOURCE_VERSION
-
Edit the "Run Tests" job and add the new version to the list of possible
+
:This should be set to the NFS version used to install the kernel from $NFS_SOURCE_SERVER (most likely $NFS_DEFAULT_VERSION).
-
values for the NFS variable.  NFS v2, v3, and v4 are configured by default.
+
-
Adding v4.1 will require modification of the mount command to add in the
+
-
"minorversion=1" mount option.
+
 +
;NFS_CLIENT_SCRIPTS
 +
:This is a path relative to $NFS_SOURCE_EXPORT/ where the client scripts are located.  If $NFS_WORKSPACE is "/home/bjschuma/jenkins/jenkins-nfs" and $NFS_SOURCE_EXPORT is "/home/bjschuma" then you should set this to "jenkins/jenkins-nfs/client/"
-
== Adding a new test ==
+
;NFS_TEST_DEFAULT_TIMEOUT
-
First design your test and edit $NFS_WORKSPACE/tests.map to add a mapping from
+
:The default number of seconds to let a test run before killing the SSH job that launched itThis may be overridden by tests that need a different value
-
name -> commandThe general format of this file is:
+
-
<pre>
+
-
        name:where:command
+
-
    name: The name of the test
 
-
    where: Where the command will be run (either "remote" or "local")
 
-
  command: The command to run the test
 
-
</pre>
 
-
Once the new test has been added to the tests.map file, add the new test to
+
== Compiling a different architecture ==
-
the "Run Tests" job.
+
Jenkins is configured to compile kernels x86_64 by default. To add other architectures, edit the "Compile" job and add a new value (such as i386) to the values list of the NFS_ARCH axis.
-
== Blacklisting a combination ==
+
== Adding a new .config ==
-
Both "Compile and Install" and "Run Tests" are configured as Jenkins
+
Copy the config file to $NFS_WORKSPACE/config/kernel using a unique nameThen add the file to the NFS_CONFIG values list in the "Test Controller" job.
-
multi-configuration projects.  This means that every combination of possible
+
-
variable values is tested.  Some combination of variables may not make sense,
+
-
such as running 32bit tests on a 64bit virtual machine.  The files in
+
-
$NFS_WORKSPACE/filters/ can be used to blacklist (or whitelist) various
+
-
combinationsThese files are simple shell scripts that should exit 0 if the
+
-
combination can be tested.  See the files in $NFS_WORKSPACE/filters/ for more
+
-
information.
+
-
== Testing NFS v4.1 ==
+
== Machine setup ==
-
NFS v4.1 is still considered to be experimental and requires manual intervention
+
There are a few requirements for a machine to work correctly as a client in the NFS Jenkins setup.
-
to enable on both the client and server.  As a result, running tests over NFS
+
-
v4.1 has been disabled by default.
+
-
Once you have your client and server configured correctly, edit the file
+
# Must have NFS client running
-
$NFS_WORKSPACE/filters/runtests and remove or comment out the block of code
+
# Must be able to run connectathon ad xfs tests
-
under "#### Disable NFS v4.1 tests ####"
+
# Passwordless sudo for SSH_USER user
 +
# Passwordless ssh enabled in the sshd config
 +
Grub must be configured to allow changing the default kernels.  This can be done by editing /boot/grub/menu.lst and changing the value "default=<some number>" to "default=saved".  You may also need to create the file /boot/grub/default to store the new default value.
-
== $NFS_WORKSPACE/scripts/functions ==
+
Using SELinux can slow down the testing step because the harddrive may occasionally need to be relabeled when booting multiple kernels.  If your tests do not depend on SELinux, you may consider disabling it by editing the file /etc/selinux/config and setting the variable SELINUX to the value "disabled" (SELINUX=disabled).
-
This file provides many convenient functions for controlling virtual machines.
+
-
You can boot, halt, and reboot machines.  You can also do more complicated
+
-
actions like sending files, mounting the nfs server and running remote commands.
+
-
Before using any of these functions, you have to tell your script what machine
+
-
everything should be run onThis is done through the set_machine function.
+
-
If you want to ls the $NFS_SSH_USER's home directory on the machine
+
-
jenkins-tests, you could do the following:
+
-
<pre>
+
-
#!/bin/bash
+
-
. functions
+
-
set_machine jenkins-tests
+
-
boot
+
-
run_cmd "ls"
+
-
halt
+
-
</pre>
+
 +
SSH keys are generated by running
-
== Virtual machine setup ==
+
<pre>$ $NFS_WORKSPACE/nfs/nfs-client-init</pre>
-
There are a few requirements for a virtual machine to work correctly for the
+
-
NFS Jenkins setup.
+
-
# Must have NFS client running
+
or by manually starting the job "Admin - Add Client".  This script will check if ~/.ssh/id_rsa.pub (your public key) exists.  If it doesn't, then ssh-keygen will be used to generate a key.  The public key will then be copied over to the virtual machine and appended to the ~/.ssh/authorized_keys file.
-
# Must be able to run connectathon tests
+
 
-
# Must be able to run xfs tests
+
This process uses ssh-copy-id to transfer your public key to the test machine, and you will be prompted for your password in the same shell that Jenkins was initially started from.
-
# Passwordless sudo for NFS_SSH_USER user
+
 
-
# Passwordless ssh configured
+
You will also need to set the environment variable MNTOPTIONS on each virtual machine so that the connectathon tests will work properly.  To do this, SSH needs to allow user environments to be set up.  This can be done by editing /etc/ssh/sshd_config and setting PermitUserEnvironment to "yes".  When mounting through the scripts in $NFS_WORKSPACE/scripts/, $MNTOPTIONS will be stored in /home/$NFS_SSH_USER/.ssh/environment to be sourced on future logins.
 +
 
 +
Note that the default userid on Fedora is 500, while other distros use 1000.  This may have an effect on your ability to access files on the NFS server.
 +
 
 +
 
 +
== Sample Machines ==
 +
Preconfigured Archlinux virtual machines can be downloaded from here:
 +
 
 +
* [http://www.linux-nfs.org/~bjschuma/Jenkins32.img 32-bit sample machine]
 +
* [http://www.linux-nfs.org/~bjschuma/Jenkins64.img 64-bit sample machine]
 +
 
 +
These machines come preconfigured with a valid user.  Log in with:
-
The sample virtual machines come preconfigured with a valid user.  Log in with:
 
<pre>
<pre>
   username: jenkins
   username: jenkins
Line 144: Line 98:
If you find you need root access:
If you find you need root access:
 +
<pre>
<pre>
   username: root
   username: root
Line 150: Line 105:
Be sure to change the root password before hosting virtual machines publicly!
Be sure to change the root password before hosting virtual machines publicly!
-
You can download sample machines here:
+
See the Archlinux Beginners' Guide for help admining the sample machines: https://wiki.archlinux.org/index.php/Beginners%27_Guide.
-
* [http://www.linux-nfs.org/~bjschuma/jenkins_master.32.img 32-bit sample machine]
+
 
-
* [http://www.linux-nfs.org/~bjschuma/jenkins_master.64.img 64-bit sample machine]
+
Archlinux, Fedora and Red Hat machines are known to work properly as NFS clients.
 +
 
 +
 
 +
== Bonus scripts ==
 +
All of the scripts in $NFS_WORKSPACE/nfs can be run by hand for simple testing outside of the Jenkins framework.  Make sure that $NFS_WORKSPACE/nfs is in your shell's $PATH (and possibly source $NFS_WORKSPACE/nfs/nfs-completion.bash for command completion).  Here is a partial list of commands:
 +
 
 +
;nfs-backup
 +
:Creates a copy of important files from the current directory. The backup will be in ~/.nfs/backups/[directory name hash].  "Important files" can be configured globally by editing ~/.nfs/backup or locally by editing ./.backup.  The default ~/.nfs/backup file will create copies of .nfsrc, .config, and *.patch from the current directory.
 +
 
 +
:Backups don't stack.  Only the most recent backup can be restored.
 +
 
 +
;nfs-boot
 +
:Boots a machine.
 +
 
 +
;nfs-client-init
 +
:Configures a client for use in other scripts.
 +
 
 +
;nfs-client-show
 +
:Displays useful information about a client, including config file location, mountpoint, ip address, supported NFS versions and possible kernels.
 +
 
 +
;nfs-config
 +
:Get or set values in the current .config file.
 +
 
 +
;nfs-halt
 +
:Halt a machine.
 +
 
 +
;nfs-install
 +
:Install a kernel on a machine.
 +
 
 +
;nfs-make
 +
:Build a kernel.
 +
 
 +
;nfs-mount
 +
:SSH into a client and mount a server over a given NFS version.
 +
 
 +
;nfs-reboot
 +
:Reboot a machine.
 +
 
 +
;nfs-restore
 +
:The opposite of nfs-backup.  Restores files from the backup directory to the current directory.
 +
 
 +
;nfs-run
 +
:This script is like a "mini-jenkins" for running basic tests during development.  Create a script with your tests called by the function "nfs_do_work" and update your .nfsrc file to set NFS_RUN_SCRIPT=[your script here].  `nfs run` will then compile and install a kernel onto your list of configured machines, reboot into these kernels, and then run your tests.
 +
 
 +
:;MACHINES
 +
::Space separated list of machine names to use.
 +
 
 +
:;NFS_VERSION
 +
::NFS version to test over.
 +
 
 +
:;NFS_SERVER
 +
::Name of the server to test against.
 +
 
 +
:;TEST_ITERATIONS
 +
::Number of times to mount, nfs_do_work, unmount.
 +
 
 +
:;TEST_SLEEP
 +
::Seconds to sleep between tests.
 +
 
 +
:;TEST_GRACE_WAIT
 +
::Set to "true" (defaults to "true") if you want to wait for the grace period to end once the server has been mounted.
 +
 
 +
:;REBOOT_AFTER_TEST
 +
::Set to "true" (default "true") if machines should be rebooted after testing.
 +
 
 +
:;UNINSTALL_AFTER_TEST
 +
::Set to "true" (default "true") if kernels should be uninstalled from machines after testihng.
 +
 
 +
:;NFS_POST_MOUNT
 +
::Command to run after all mounts have finished.
 +
 
 +
:;NFS_POST_UMOUNT
 +
::Command to run after all unmounts have finished.
 +
 
 +
:;NFS_EXIT
 +
::Command to run when `nfs run` exits.
 +
 
 +
;nfs-server-init
 +
:Initializes a server.  Similar to `nfs-client-init`
 +
 
 +
;nfs-server-show
 +
:Shows useful information about a server. Similar to `nfs-client-show`
 +
 
 +
;nfs-show
 +
:Shows the resulting NFS environment after first reading the global ~/.nfs/nfsrc file and then the local .nfsrc file.
 +
 
 +
;nfs-ssh
 +
:SSH into a machine
-
Passwordless ssh can be configured by running $NFS_WORKSPACE/scripts/init_vm
+
;nfs-test
-
or by manually starting the job "Admin - Initialize VM".  This script will check
+
:Run a test on a client against a server over a specific NFS version
-
if ~/.ssh/id_rsa.pub (your public key) exists.  If it doesn't, then ssh-keygen
+
-
will be used to generate a key.  The public key will then be copied over to the
+
-
virtual machine and appended to the ~/.ssh/authorized_keys file.
+
-
This process will require you to enter your password twice, once for the file
+
;nfs-umount
-
transfer and once for appending to the authorized_keys file.  Due to a
+
:Unmounts a client's NFS mountpoint
-
limitation in the Jenkins software, the password must be entered in the same
+
-
shell that Jenkins was initially started from.
+
-
You will also need to set the environment variable MNTOPTIONS on each virtual
+
;nfs-uninstall
-
machine so that the connectathon tests will work properly.  To do this, SSH
+
:Removes a kernel from a client
-
needs to allow user environments to be set up. This can be done by editing
+
-
/etc/ssh/sshd_config and setting PermitUserEnvironment to "yes".  When mounting
+
-
through the scripts in $NFS_WORKSPACE/scripts/, $MNTOPTIONS will be stored in
+
-
/home/$NFS_SSH_USER/.ssh/environment to be sourced on future logins.
+
-
The install step will mount the server through NFS v4, so at the very least
+
These scripts store their data in ~/.nfs/ when running by hand to avoid collisions with Jenkins config directory.  The downside is that clients and servers must be reinitialized (or just copy the config file) from the Jenkins directory ($NFS_WORKSPACE/config/clients or $NFS_WORKSPACE/config/servers).
-
NFS v4 needs to be working on the client and server.
+
-
Archlinux and Fedora virtual machines are known to work properly.
+
Similar to git, you can create any script prefixed with "nfs-" and the generic `nfs` command will be able to run (and autocomplete) it.  Unfortunately, help text isn't the best and getopt-style arguments have yet to be implemented.  Commands must be run with correct positional arguments.  This will hopefully change in the future.

Latest revision as of 20:32, 13 November 2012

I'm going to skip over basic Jenkins usage to keep this document short. You can look at http://www.jenkins-ci.org if you need help using the Jenkins java program.


Contents

Basic Setup

Begin by cloning the jenkins-nfs git repository:

$ git clone git://git.linux-nfs.org/projects/bjschuma/jenkins-nfs.git

The cloned directory should be placed in a location exported by the NFS server running on the host machine. The full path up to and including this directory is referred to as $NFS_WORKSPACE throughout this document and various scripts.

Once you have the latest version of the scripts, cd into $NFS_WORKSPACE and run:

$ ./setup.sh

to download the Jenkins executable, required plugins, and to configure the Jenkins environment. This includes creating a symlink in your home directory ~/.jenkins -> $NFS_WORKSPACE/jenkins. When you are ready, run

$ ./start_jenkins

to start Jenkins and point your web browser to localhost:8080 to see the web gui.

Use the "Admin - Add Client" and "Admin - Add Server" jobs on the "Admin" tab to set up machine profiles for testing. Edit the "Run Clients" job to set your list of clients as possible values for the NFS_CLIENT field. Edit the "Run Tests" job to set your list of servers as possible values for the NFS_SERVER field.

If you want to test the latest linux-next code from Trond's tree, run the "Linux NFS" job to check out and run the code. You may want to change the default value for the SRC_DIR parameter so you don't have to enter the path all the time (and also because the job is currently configured for Bryan's setup...).

You can also run the "Test Controller" job on the "Common" tab to test a kernel without updating it from git first.


config/nfsrc

This is the basic configuration file used by the scripts in $NFS_WORKSPACE/nfs/ to set up a default environment. Any changes here will not require you to restart Jenkins and should take effect almost immediately.

NFS_DEFAULT_SERVER
This should be set to the name (see `nfs server init`) of the server used by the nfs* commands when no server is specified. In most cases you probably want to set this to the machine hosting Jenkins.
NFS_DEFAULT_VERSION
This should be set to the NFS version used by clients when mounting $NFS_DEFAULT_SERVER.
NFS_SOURCE_EXPORT
This should be set to the directory exported by the NFS server hosting the compiled Linux code.
NFS_SOURCE_SERVER
This should be set to the machine hosting the compiled Linux code (most likely $NFS_DEFAULT_SERVER).
NFS_SOURCE_VERSION
This should be set to the NFS version used to install the kernel from $NFS_SOURCE_SERVER (most likely $NFS_DEFAULT_VERSION).
NFS_CLIENT_SCRIPTS
This is a path relative to $NFS_SOURCE_EXPORT/ where the client scripts are located. If $NFS_WORKSPACE is "/home/bjschuma/jenkins/jenkins-nfs" and $NFS_SOURCE_EXPORT is "/home/bjschuma" then you should set this to "jenkins/jenkins-nfs/client/"
NFS_TEST_DEFAULT_TIMEOUT
The default number of seconds to let a test run before killing the SSH job that launched it. This may be overridden by tests that need a different value


Compiling a different architecture

Jenkins is configured to compile kernels x86_64 by default. To add other architectures, edit the "Compile" job and add a new value (such as i386) to the values list of the NFS_ARCH axis.


Adding a new .config

Copy the config file to $NFS_WORKSPACE/config/kernel using a unique name. Then add the file to the NFS_CONFIG values list in the "Test Controller" job.


Machine setup

There are a few requirements for a machine to work correctly as a client in the NFS Jenkins setup.

  1. Must have NFS client running
  2. Must be able to run connectathon ad xfs tests
  3. Passwordless sudo for SSH_USER user
  4. Passwordless ssh enabled in the sshd config

Grub must be configured to allow changing the default kernels. This can be done by editing /boot/grub/menu.lst and changing the value "default=<some number>" to "default=saved". You may also need to create the file /boot/grub/default to store the new default value.

Using SELinux can slow down the testing step because the harddrive may occasionally need to be relabeled when booting multiple kernels. If your tests do not depend on SELinux, you may consider disabling it by editing the file /etc/selinux/config and setting the variable SELINUX to the value "disabled" (SELINUX=disabled).

SSH keys are generated by running

$ $NFS_WORKSPACE/nfs/nfs-client-init

or by manually starting the job "Admin - Add Client". This script will check if ~/.ssh/id_rsa.pub (your public key) exists. If it doesn't, then ssh-keygen will be used to generate a key. The public key will then be copied over to the virtual machine and appended to the ~/.ssh/authorized_keys file.

This process uses ssh-copy-id to transfer your public key to the test machine, and you will be prompted for your password in the same shell that Jenkins was initially started from.

You will also need to set the environment variable MNTOPTIONS on each virtual machine so that the connectathon tests will work properly. To do this, SSH needs to allow user environments to be set up. This can be done by editing /etc/ssh/sshd_config and setting PermitUserEnvironment to "yes". When mounting through the scripts in $NFS_WORKSPACE/scripts/, $MNTOPTIONS will be stored in /home/$NFS_SSH_USER/.ssh/environment to be sourced on future logins.

Note that the default userid on Fedora is 500, while other distros use 1000. This may have an effect on your ability to access files on the NFS server.


Sample Machines

Preconfigured Archlinux virtual machines can be downloaded from here:

These machines come preconfigured with a valid user. Log in with:

   username: jenkins
   password: jenkins

If you find you need root access:

   username: root
   password: jenkins

Be sure to change the root password before hosting virtual machines publicly! See the Archlinux Beginners' Guide for help admining the sample machines: https://wiki.archlinux.org/index.php/Beginners%27_Guide.

Archlinux, Fedora and Red Hat machines are known to work properly as NFS clients.


Bonus scripts

All of the scripts in $NFS_WORKSPACE/nfs can be run by hand for simple testing outside of the Jenkins framework. Make sure that $NFS_WORKSPACE/nfs is in your shell's $PATH (and possibly source $NFS_WORKSPACE/nfs/nfs-completion.bash for command completion). Here is a partial list of commands:

nfs-backup
Creates a copy of important files from the current directory. The backup will be in ~/.nfs/backups/[directory name hash]. "Important files" can be configured globally by editing ~/.nfs/backup or locally by editing ./.backup. The default ~/.nfs/backup file will create copies of .nfsrc, .config, and *.patch from the current directory.
Backups don't stack. Only the most recent backup can be restored.
nfs-boot
Boots a machine.
nfs-client-init
Configures a client for use in other scripts.
nfs-client-show
Displays useful information about a client, including config file location, mountpoint, ip address, supported NFS versions and possible kernels.
nfs-config
Get or set values in the current .config file.
nfs-halt
Halt a machine.
nfs-install
Install a kernel on a machine.
nfs-make
Build a kernel.
nfs-mount
SSH into a client and mount a server over a given NFS version.
nfs-reboot
Reboot a machine.
nfs-restore
The opposite of nfs-backup. Restores files from the backup directory to the current directory.
nfs-run
This script is like a "mini-jenkins" for running basic tests during development. Create a script with your tests called by the function "nfs_do_work" and update your .nfsrc file to set NFS_RUN_SCRIPT=[your script here]. `nfs run` will then compile and install a kernel onto your list of configured machines, reboot into these kernels, and then run your tests.
MACHINES
Space separated list of machine names to use.
NFS_VERSION
NFS version to test over.
NFS_SERVER
Name of the server to test against.
TEST_ITERATIONS
Number of times to mount, nfs_do_work, unmount.
TEST_SLEEP
Seconds to sleep between tests.
TEST_GRACE_WAIT
Set to "true" (defaults to "true") if you want to wait for the grace period to end once the server has been mounted.
REBOOT_AFTER_TEST
Set to "true" (default "true") if machines should be rebooted after testing.
UNINSTALL_AFTER_TEST
Set to "true" (default "true") if kernels should be uninstalled from machines after testihng.
NFS_POST_MOUNT
Command to run after all mounts have finished.
NFS_POST_UMOUNT
Command to run after all unmounts have finished.
NFS_EXIT
Command to run when `nfs run` exits.
nfs-server-init
Initializes a server. Similar to `nfs-client-init`
nfs-server-show
Shows useful information about a server. Similar to `nfs-client-show`
nfs-show
Shows the resulting NFS environment after first reading the global ~/.nfs/nfsrc file and then the local .nfsrc file.
nfs-ssh
SSH into a machine
nfs-test
Run a test on a client against a server over a specific NFS version
nfs-umount
Unmounts a client's NFS mountpoint
nfs-uninstall
Removes a kernel from a client

These scripts store their data in ~/.nfs/ when running by hand to avoid collisions with Jenkins config directory. The downside is that clients and servers must be reinitialized (or just copy the config file) from the Jenkins directory ($NFS_WORKSPACE/config/clients or $NFS_WORKSPACE/config/servers).

Similar to git, you can create any script prefixed with "nfs-" and the generic `nfs` command will be able to run (and autocomplete) it. Unfortunately, help text isn't the best and getopt-style arguments have yet to be implemented. Commands must be run with correct positional arguments. This will hopefully change in the future.

Personal tools