1 # 2 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 3 # Use is subject to license terms. 4 # 5 6 # 7 # BSD 3 Clause License 8 # 9 # Redistribution and use in source and binary forms, with or without 10 # modification, are permitted provided that the following conditions 11 # are met: 12 # - Redistributions of source code must retain the above copyright 13 # notice, this list of conditions and the following disclaimer. 14 # 15 # - Redistributions in binary form must reproduce the above copyright 16 # notice, this list of conditions and the following disclaimer in 17 # the documentation and/or other materials provided with the 18 # distribution. 19 # 20 # - Neither the name of Sun Microsystems, Inc. nor the 21 # names of its contributors may be used to endorse or promote products 22 # derived from this software without specific prior written permission. 23 # 24 # THIS SOFTWARE IS PROVIDED BY SUN MICROSYSTEMS, INC. "AS IS" AND ANY 25 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 # DISCLAIMED. IN NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY 28 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES 30 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 # 35 # 36 # Copyright 2015 Nexenta Systems, Inc. All rights reserved. 37 # 38 39 DESCRIPTION 40 =========== 41 This is the NDMP (Network Data Management Protocol) Protocol test suite. 42 It automates protocol testing of NDMP server. 43 44 45 PREREQUISITES 46 ============= 47 1. A tape library is required. 48 2. The CTI-TET test harness lite package SUNWstc-tetlite is required. 49 You can find the package on the OpenSolaris Test Consolidation: 50 http://www.opensolaris.org/os/community/testing/testsuites/ctifortet/ 51 52 53 CTI-TET INSTALLATION 54 ==================== 55 In the majority of cases, the CTI-TET lite harness can be installed 56 from packages. Installation is via the standard Solaris package 57 installation tool, pkgadd(1M). The package is named SUNWstc-tetlite 58 and it installs into "/opt" by default. 59 60 To install SUNWstc-tetlite, enter the following command: 61 62 root# pkgadd -d <package_location> SUNWstc-tetlite 63 64 where <package_location> is the path containing the SUNWstc-tetlite 65 package directory. 'root#' indicates that this command must be run 66 as root. 67 68 o It is recommended that SUNWstc-tetlite be installed from scratch, 69 rather than on top of an existing installation. Thus, if a copy 70 of SUNWstc-tetlite is already installed, remove it: 71 72 root# pkgrm SUNWstc-tetlite 73 74 75 TEST SUITE INSTALLATION 76 ======================= 77 In the majority of cases, the test suite can be installed from packages. 78 The package is called SUNWstc-storage-ndmp-protocol and it installs into 79 "/opt" by default. Installation is via the standard Solaris package 80 installation tool, pkgadd(1M). To install SUNWstc-storage-ndmp-protocol, 81 enter the following command: 82 83 root# pkgadd -d <package_location> SUNWstc-storage-ndmp-protocol 84 85 where <package_location> is the path containing the ndmp-protocol test 86 suite package directory. 87 88 It is recommended that the test suite package be installed from scratch, 89 rather than on top of an existing installation. Thus, if a version of 90 the test suite package is already installed, first remove it: 91 92 root# pkgrm SUNWstc-storage-ndmp-protocol 93 94 It is acceptable to use an NFS-accessible installation of the test suite. 95 96 ALTERNATIVELY, the test suite souce code can be installed and the test 97 suite package can be built from source. This is optional. Instructions 98 for building the test suite are provided in the section titled "BUILDING 99 TEST SUITE (OPTIONAL)". 100 101 102 TEST SUITE CONFIGURATION 103 ======================== 104 Test suite configuration must be performed as 'root'. 105 106 1. Set the following environment variables 107 108 export TET_ROOT=/opt/SUNWstc-tetlite 109 export CTI_ROOT=$TET_ROOT/contrib/ctitools 110 export PATH=$PATH:$CTI_ROOT/bin 111 export TET_SUITE_ROOT=/opt/SUNWstc-storage-ndmp-protocol 112 113 The values used above for the different variables are for example only. 114 Make sure to substitute the correct directory paths based on the actual 115 install locations of SUNWstc-tetlite and SUNWstc-storage-ndmp-protocol 116 117 2. To configure the test suite 118 119 a. run the following command with the option to configure the test suite 120 121 root# run_test -v NDMP_SERVER_IP=<ip-address> \ 122 -v NDMP_USER=<User Name> -v NDMP_PASSWORD=<password> \ 123 -v NDMP_AUTH=NDMP_AUTH_TEXT -v NDMP_TAPE_DEV=<tape dev> \ 124 -v NDMP_ROBOT=<tape changer> ndmp/protocol configure \ 125 -v NDMP_FS=<NDMP server File system to backup> 126 127 Example: run_test -v NDMP_SERVER_IP=10.12.178.122 -v NDMP_USER=admin 128 -v NDMP_PASSWORD=admin -v NDMP_AUTH=NDMP_AUTH_TEXT 129 -v NDMP_TAPE_DEV=/dev/rmt/0n 130 -v NDMP_ROBOT=/dev/scsi/changer/c1t210000E08B86CCAFd2 131 -v NDMP_FS=/var/log/ 132 ndmp/protocol configure 133 134 3. Configuration the NDMP server machine. 135 136 a. Create an NDMP admin user on the ndmp server: 137 root# ndmpadm enable -a <auth-type> <-u username> 138 139 For example 140 root# ndmpadm enable -a cleartext -u admin 141 142 A password will be required; please enter 'admin' as password. 143 144 b. Configure a tape library on the NDMP server machine. 145 146 Get the device mappings on the NDMP server by issuing: 147 root# ndmpadm show-devices 148 149 Make sure that tape-device has a tape loaded in the drive and is not busy. 150 The following command displays the status of the magnetic tape drive 151 152 root# mt -f <device-name> status 153 154 155 TEST SUITE EXECUTION 156 ==================== 157 The test suite must be executed as root. 158 159 If not already done, from the configuration phase, do the following to 160 set the environmental variables: 161 162 Using NDMP Protocol test suite package: 163 export TET_ROOT=/opt/SUNWstc-tetlite 164 export CTI_ROOT=$TET_ROOT/contrib/ctitools 165 export PATH=$PATH:$CTI_ROOT/bin 166 export TET_SUITE_ROOT=/opt/SUNWstc-storage-ndmp-protocol 167 168 Once again, the values used above are for example only. Please make 169 sure to set the correct values based on the actual install location 170 of SUNWstc-tetlite and SUNWstc-storage-ndmp-protocol 171 172 To run the entire test suite do the following: 173 174 root# run_test ndmp/protocol 175 176 To run all the test purposes: 177 178 root# run_test ndmp/protocol all 179 180 To execute individual scenarios, run: 181 root# run_test ndmp/protocol <scenario> 182 For example: 183 root# run_test ndmp/protocol MOVER 184 185 To execute a Test Purpose within a scenario, run: 186 root# run_test ndmp/protocol \ 187 <scenario>/<test case dir>:<test purpose number> 188 For example: 189 root# run_test ndmp/protocol MOVER/tp_MOVER_ABORT_ISE 190 191 Test case directories are CONFIG, DATA, POST, SCSI, MOVER and TAPE. 192 The log file will be located in /var/tmp/tests directory. 193 194 195 Note: You can define customized test scenarios by adding entries to 196 the test scenario file: $TET_SUITE_ROOT/ndmp/protocol/tet_scen. 197 198 For how to edit the test scenario file, refer to the TET user guide at: 199 http://tetworks.opengroup.org/tet/ 200 201 TEST SUITE UNCONFIGURATION 202 ========================== 203 The test suite must be unconfigured as root. 204 root# run_test ndmp/protocol unconfigure 205 206 BUILDING THE TEST SUITE (OPTIONAL) 207 ================================= 208 The following pre-requisites must be satisfied before the test 209 suite can be successfully built from source. 210 211 . Sun Solaris 10 and above Operating System is required. 212 . Sun Studio 11 should be installed 213 . Perl 5.8.4 should be installed 214 . /usr/ccs/bin/make should be used for making 215 216 Executing tests using precompiled test suite packages is the method we 217 strongly recommend. However, if, for some reason, you need to build 218 test suite binaries from source, simply do the following: 219 220 1. Install SUNWstc-tetlite (see instructions earlier in this file) 221 2. Obtain the ndmp protocol test suite source 222 3. Build Test Suite Binaries 223 224 (a) Install SUNWstc-tetlite 225 226 Install the precompiled SUNWstc-tetlite package. Detailed instructions 227 are provided earlier in this file. 228 229 (b) Obtain the ndmp-protocol test suite source 230 231 Obtain the test suite source code from your source code repository 232 which will contain the following directory structure 233 <WS_ROOT>/usr/src/suites/storage/ndmp/protocol 234 235 where <WS_ROOT> is the root of the workspace under which the 236 ndmp-protocol test suite resides. 237 238 (c) Build Test Suite Binaries 239 240 Building test suite binaries does not need 'root' permissions. 241 242 user$ export TET_ROOT=/opt/SUNWstc-tetlite 243 user$ export CTI_ROOT=$TET_ROOT/contrib/ctitools 244 user$ export PATH=$PATH:$CTI_ROOT/bin 245 user$ export TET_SUITE_ROOT=<WS_ROOT>/usr/src/suites/storage/ 246 user$ cd <WS_ROOT>/usr/src/suites/storage/ndmp/protocol 247 248 where <WS_ROOT> is the root of the workspace under which the 249 ndmp-protocol test suite resides. Use 'make' to compile the source: 250 251 user$ make 252 ... 253 ... (many lines of 'make' and shell output ensue) 254 ... 255 256 The above command, if successful, will build the test suite 'proto' 257 directory. After a successful build, the proto area can be used to 258 construct the test suite package: 259 260 user$ make package 261 262 This will build the package supported by the current machine's system 263 architecure (e.g., if building on an x64 system, packages relevant to 264 the "i386" architecture will be built.) 265 266 Once the test suite package has been built, install the package as 267 instructed in the section "TEST SUITE INSTALLATION" in order to 268 install the test suite. 269