github.com/swiftstack/proxyfs@v0.0.0-20201223034610-5434d919416e/transitions/api_test.go (about) 1 package transitions 2 3 import ( 4 "fmt" 5 "sort" 6 "testing" 7 8 "github.com/swiftstack/ProxyFS/conf" 9 ) 10 11 type testCallbacksInterfaceStruct struct { 12 name string 13 t *testing.T 14 } 15 16 var testConfStrings = []string{ 17 "Logging.LogFilePath=/dev/null", 18 "Logging.LogToConsole=false", 19 "FlowControl:FlowControlX.MaxFlushSize=10000000", 20 "FlowControl:FlowControlX.MaxFlushTime=10s", 21 "FlowControl:FlowControlX.FileDefragmentChunkSize=10000000", 22 "FlowControl:FlowControlX.FileDefragmentChunkDelay=10ms", 23 "FlowControl:FlowControlX.ReadCacheLineSize=1000000", 24 "FlowControl:FlowControlX.ReadCacheWeight=100", 25 "FlowControl:FlowControlY.MaxFlushSize=20000000", 26 "FlowControl:FlowControlY.MaxFlushTime=20s", 27 "FlowControl:FlowControlY.FileDefragmentChunkSize=20000000", 28 "FlowControl:FlowControlY.FileDefragmentChunkDelay=20ms", 29 "FlowControl:FlowControlY.ReadCacheLineSize=2000000", 30 "FlowControl:FlowControlY.ReadCacheWeight=200", 31 "Volume:VolumeA.PrimaryPeer=Peer0", 32 "Volume:VolumeA.FlowControl=FlowControlX", 33 "Volume:VolumeB.PrimaryPeer=Peer0", // Will migrate to Peer1 34 "Volume:VolumeB.FlowControl=FlowControlY", 35 "Volume:VolumeC.PrimaryPeer=Peer1", // Will migrate to Peer2...then destroyed 36 "Volume:VolumeC.FlowControl=FlowControlX", 37 "Volume:VolumeD.PrimaryPeer=Peer2", // Will migrate to Peer0...then destroyed 38 "Volume:VolumeD.FlowControl=FlowControlY", 39 // VolumeE will be created on Peer0 40 // VolumeF will be created on Peer1 41 // VolumeG will be created on Peer2...then migrate to VolumeF's VolumeGroup 42 "FSGlobals.VolumeList=VolumeA,VolumeB,VolumeC,VolumeD", 43 "FSGlobals.CheckpointHeaderConsensusAttempts=5", 44 "FSGlobals.MountRetryLimit=6", 45 "FSGlobals.MountRetryDelay=1s", 46 "FSGlobals.MountRetryExpBackoff=2", 47 "FSGlobals.LogCheckpointHeaderPosts=true", 48 "FSGlobals.TryLockBackoffMin=10ms", 49 "FSGlobals.TryLockBackoffMax=50ms", 50 "FSGlobals.TryLockSerializationThreshhold=5", 51 "FSGlobals.SymlinkMax=32", 52 "FSGlobals.CoalesceElementChunkSize=16", 53 "Cluster.Peers=Peer0,Peer1,Peer2,Peer3", 54 "Cluster.WhoAmI=Peer0", 55 "Transitions.AutoVolumeGroupPrefix=V_", 56 "Transitions.AutoVolumeGroupSuffix=_G", 57 } 58 59 var testConfStringsToAddVolumeE = []string{ 60 "Volume:VolumeE.MaxFlushSize=30000000", 61 "Volume:VolumeE.MaxFlushTime=30s", 62 "Volume:VolumeE.FileDefragmentChunkSize=30000000", 63 "Volume:VolumeE.FileDefragmentChunkDelay=30ms", 64 "VolumeGroup:VG_One.PrimaryPeer=Peer0", 65 "VolumeGroup:VG_One.ReadCacheLineSize=3000000", 66 "VolumeGroup:VG_One.ReadCacheWeight=300", 67 "VolumeGroup:VG_One.VirtualIPAddr=", 68 "VolumeGroup:VG_One.VolumeList=VolumeE", 69 "FSGlobals.VolumeGroupList=V_VolumeA_G,V_VolumeB_G,VG_One", 70 } 71 72 var testConfStringsToAddVolumeF = []string{ 73 "Volume:VolumeF.MaxFlushSize=40000000", 74 "Volume:VolumeF.MaxFlushTime=40s", 75 "Volume:VolumeF.FileDefragmentChunkSize=40000000", 76 "Volume:VolumeF.FileDefragmentChunkDelay=40ms", 77 "VolumeGroup:VG_Two.PrimaryPeer=Peer1", 78 "VolumeGroup:VG_Two.ReadCacheLineSize=4000000", 79 "VolumeGroup:VG_Two.ReadCacheWeight=400", 80 "VolumeGroup:VG_Two.VirtualIPAddr=", 81 "VolumeGroup:VG_Two.VolumeList=VolumeF", 82 "FSGlobals.VolumeGroupList=V_VolumeA_G,V_VolumeB_G,VG_One,VG_Two", 83 } 84 85 var testConfStringsToAddVolumeG = []string{ 86 "Volume:VolumeG.MaxFlushSize=50000000", 87 "Volume:VolumeG.MaxFlushTime=50s", 88 "Volume:VolumeG.FileDefragmentChunkSize=50000000", 89 "Volume:VolumeG.FileDefragmentChunkDelay=50ms", 90 "VolumeGroup:VG_Three.PrimaryPeer=Peer2", 91 "VolumeGroup:VG_Three.ReadCacheLineSize=5000000", 92 "VolumeGroup:VG_Three.ReadCacheWeight=500", 93 "VolumeGroup:VG_Three.VirtualIPAddr=", 94 "VolumeGroup:VG_Three.VolumeList=VolumeG", 95 "FSGlobals.VolumeGroupList=V_VolumeA_G,V_VolumeB_G,VG_One,VG_Two,VG_Three", 96 } 97 98 var testConfStringsToMoveVolumeG = []string{ 99 "VolumeGroup:VG_Two.VolumeList=VolumeF,VolumeG", 100 "VolumeGroup:VG_Three.VolumeList=", 101 "FSGlobals.VolumeGroupList=V_VolumeA_G,V_VolumeB_G,VG_One,VG_Two,VG_Three", 102 } 103 104 var testCallbackLog []string // Accumulates log messages output by transitions.Callbacks implementations 105 106 func testValidateUpgradedConfMap(t *testing.T, testConfMap conf.ConfMap) { 107 var ( 108 fileDefragmentChunkDelay conf.ConfMapOption 109 fileDefragmentChunkDelayOK bool 110 fileDefragmentChunkSize conf.ConfMapOption 111 fileDefragmentChunkSizeOK bool 112 fsGlobals conf.ConfMapSection 113 fsGlobalsOK bool 114 maxFlushSize conf.ConfMapOption 115 maxFlushSizeOK bool 116 maxFlushTime conf.ConfMapOption 117 maxFlushTimeOK bool 118 primaryPeer conf.ConfMapOption 119 primaryPeerOK bool 120 readCacheLineSize conf.ConfMapOption 121 readCacheLineSizeOK bool 122 readCacheWeight conf.ConfMapOption 123 readCacheWeightOK bool 124 testVolume conf.ConfMapSection 125 testVolumeGroup conf.ConfMapSection 126 testVolumeGroupOK bool 127 testVolumeOK bool 128 virtualIPAddr conf.ConfMapOption 129 virtualIPAddrOK bool 130 volumeGroupList conf.ConfMapOption 131 volumeGroupListOK bool 132 volumeList conf.ConfMapOption 133 volumeListOK bool 134 ) 135 136 // Validate FSGlobals 137 138 fsGlobals, fsGlobalsOK = testConfMap["FSGlobals"] 139 if !fsGlobalsOK { 140 t.Fatalf("testConfMap must contain an FSGlobals section") 141 } 142 143 volumeGroupList, volumeGroupListOK = fsGlobals["VolumeGroupList"] 144 if !volumeGroupListOK || (4 != len(volumeGroupList)) || ("V_VolumeA_G" != volumeGroupList[0]) || ("V_VolumeB_G" != volumeGroupList[1]) || ("V_VolumeC_G" != volumeGroupList[2]) || ("V_VolumeD_G" != volumeGroupList[3]) { 145 t.Fatalf("testConfMap missing FSGlobals.VolumeGroupList=V_VolumeA_G,V_VolumeB_G,V_VolumeC_G,V_VolumeD_G") 146 } 147 148 // Validate VolumeGroup:V_VolumeA_G 149 150 testVolumeGroup, testVolumeGroupOK = testConfMap["VolumeGroup:V_VolumeA_G"] 151 if !testVolumeGroupOK { 152 t.Fatalf("testConfMap must contain a VolumeGroup:V_VolumeA_G section") 153 } 154 155 volumeList, volumeListOK = testVolumeGroup["VolumeList"] 156 if !volumeListOK || (1 != len(volumeList)) || ("VolumeA" != volumeList[0]) { 157 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.VolumeList=VolumeA") 158 } 159 virtualIPAddr, virtualIPAddrOK = testVolumeGroup["VirtualIPAddr"] 160 if !virtualIPAddrOK || (0 != len(virtualIPAddr)) { 161 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.VirtualIPAddr=") 162 } 163 primaryPeer, primaryPeerOK = testVolumeGroup["PrimaryPeer"] 164 if !primaryPeerOK || (1 != len(primaryPeer)) || ("Peer0" != primaryPeer[0]) { 165 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.PrimaryPeer=Peer0") 166 } 167 readCacheLineSize, readCacheLineSizeOK = testVolumeGroup["ReadCacheLineSize"] 168 if !readCacheLineSizeOK || (1 != len(readCacheLineSize)) || ("1000000" != readCacheLineSize[0]) { 169 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.ReadCacheLineSize=1000000") 170 } 171 readCacheWeight, readCacheWeightOK = testVolumeGroup["ReadCacheWeight"] 172 if !readCacheWeightOK || (1 != len(readCacheWeight)) || ("100" != readCacheWeight[0]) { 173 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.ReadCacheWeight=100") 174 } 175 176 testVolume, testVolumeOK = testConfMap["Volume:VolumeA"] 177 if !testVolumeOK { 178 t.Fatalf("testConfMap must contain a Volume:VolumeA section") 179 } 180 181 maxFlushSize, maxFlushSizeOK = testVolume["MaxFlushSize"] 182 if !maxFlushSizeOK || (1 != len(maxFlushSize)) || ("10000000" != maxFlushSize[0]) { 183 t.Fatalf("testConfMap missing Volume:VolumeA.MaxFlushSize=10000000") 184 } 185 maxFlushTime, maxFlushTimeOK = testVolume["MaxFlushTime"] 186 if !maxFlushTimeOK || (1 != len(maxFlushTime)) || ("10s" != maxFlushTime[0]) { 187 t.Fatalf("testConfMap missing Volume:VolumeA.MaxFlushTime=10s") 188 } 189 190 fileDefragmentChunkSize, fileDefragmentChunkSizeOK = testVolume["FileDefragmentChunkSize"] 191 if !fileDefragmentChunkSizeOK || (1 != len(fileDefragmentChunkSize)) || ("10000000" != fileDefragmentChunkSize[0]) { 192 t.Fatalf("testConfigMap has invalid Volume:VolumeA.FileDefragmentChunkSize") 193 } 194 fileDefragmentChunkDelay, fileDefragmentChunkDelayOK = testVolume["FileDefragmentChunkDelay"] 195 if !fileDefragmentChunkDelayOK || (1 != len(fileDefragmentChunkDelay)) || ("10ms" != fileDefragmentChunkDelay[0]) { 196 t.Fatalf("testConfigMap has invalid Volume:VolumeA.FileDefragmentChunkDelay") 197 } 198 199 // Validate VolumeGroup:V_VolumeB_G 200 201 testVolumeGroup, testVolumeGroupOK = testConfMap["VolumeGroup:V_VolumeB_G"] 202 if !testVolumeGroupOK { 203 t.Fatalf("testConfMap must contain a VolumeGroup:V_VolumeB_G section") 204 } 205 206 volumeList, volumeListOK = testVolumeGroup["VolumeList"] 207 if !volumeListOK || (1 != len(volumeList)) || ("VolumeB" != volumeList[0]) { 208 t.Fatalf("testConfMap missing VolumeGroup:VolumeB.VolumeList=VolumeB") 209 } 210 virtualIPAddr, virtualIPAddrOK = testVolumeGroup["VirtualIPAddr"] 211 if !virtualIPAddrOK || (0 != len(virtualIPAddr)) { 212 t.Fatalf("testConfMap missing VolumeGroup:VolumeB.VirtualIPAddr=") 213 } 214 primaryPeer, primaryPeerOK = testVolumeGroup["PrimaryPeer"] 215 if !primaryPeerOK || (1 != len(primaryPeer)) || ("Peer0" != primaryPeer[0]) { 216 t.Fatalf("testConfMap missing VolumeGroup:VolumeB.PrimaryPeer=Peer0") 217 } 218 readCacheLineSize, readCacheLineSizeOK = testVolumeGroup["ReadCacheLineSize"] 219 if !readCacheLineSizeOK || (1 != len(readCacheLineSize)) || ("2000000" != readCacheLineSize[0]) { 220 t.Fatalf("testConfMap missing VolumeGroup:VolumeB.ReadCacheLineSize=2000000") 221 } 222 readCacheWeight, readCacheWeightOK = testVolumeGroup["ReadCacheWeight"] 223 if !readCacheWeightOK || (1 != len(readCacheWeight)) || ("200" != readCacheWeight[0]) { 224 t.Fatalf("testConfMap missing VolumeGroup:VolumeB.ReadCacheWeight=200") 225 } 226 227 testVolume, testVolumeOK = testConfMap["Volume:VolumeB"] 228 if !testVolumeOK { 229 t.Fatalf("testConfMap must contain a Volume:VolumeB section") 230 } 231 232 maxFlushSize, maxFlushSizeOK = testVolume["MaxFlushSize"] 233 if !maxFlushSizeOK || (1 != len(maxFlushSize)) || ("20000000" != maxFlushSize[0]) { 234 t.Fatalf("testConfMap missing Volume:VolumeB.MaxFlushSize=20000000") 235 } 236 maxFlushTime, maxFlushTimeOK = testVolume["MaxFlushTime"] 237 if !maxFlushTimeOK || (1 != len(maxFlushTime)) || ("20s" != maxFlushTime[0]) { 238 t.Fatalf("testConfMap missing Volume:VolumeB.MaxFlushTime=20s") 239 } 240 241 fileDefragmentChunkSize, fileDefragmentChunkSizeOK = testVolume["FileDefragmentChunkSize"] 242 if !fileDefragmentChunkSizeOK || (1 != len(fileDefragmentChunkSize)) || ("20000000" != fileDefragmentChunkSize[0]) { 243 t.Fatalf("testConfigMap has invalid Volume:VolumeB.FileDefragmentChunkSize") 244 } 245 fileDefragmentChunkDelay, fileDefragmentChunkDelayOK = testVolume["FileDefragmentChunkDelay"] 246 if !fileDefragmentChunkDelayOK || (1 != len(fileDefragmentChunkDelay)) || ("20ms" != fileDefragmentChunkDelay[0]) { 247 t.Fatalf("testConfigMap has invalid Volume:VolumeB.FileDefragmentChunkDelay") 248 } 249 250 // Validate VolumeGroup:V_VolumeC_G 251 252 testVolumeGroup, testVolumeGroupOK = testConfMap["VolumeGroup:V_VolumeC_G"] 253 if !testVolumeGroupOK { 254 t.Fatalf("testConfMap must contain a VolumeGroup:V_VolumeC_G section") 255 } 256 257 volumeList, volumeListOK = testVolumeGroup["VolumeList"] 258 if !volumeListOK || (1 != len(volumeList)) || ("VolumeC" != volumeList[0]) { 259 t.Fatalf("testConfMap missing VolumeGroup:VolumeC.VolumeList=VolumeC") 260 } 261 virtualIPAddr, virtualIPAddrOK = testVolumeGroup["VirtualIPAddr"] 262 if !virtualIPAddrOK || (0 != len(virtualIPAddr)) { 263 t.Fatalf("testConfMap missing VolumeGroup:VolumeC.VirtualIPAddr=") 264 } 265 primaryPeer, primaryPeerOK = testVolumeGroup["PrimaryPeer"] 266 if !primaryPeerOK || (1 != len(primaryPeer)) || ("Peer1" != primaryPeer[0]) { 267 t.Fatalf("testConfMap missing VolumeGroup:VolumeA.PrimaryPeer=Peer1") 268 } 269 readCacheLineSize, readCacheLineSizeOK = testVolumeGroup["ReadCacheLineSize"] 270 if !readCacheLineSizeOK || (1 != len(readCacheLineSize)) || ("1000000" != readCacheLineSize[0]) { 271 t.Fatalf("testConfMap missing VolumeGroup:VolumeC.ReadCacheLineSize=1000000") 272 } 273 readCacheWeight, readCacheWeightOK = testVolumeGroup["ReadCacheWeight"] 274 if !readCacheWeightOK || (1 != len(readCacheWeight)) || ("100" != readCacheWeight[0]) { 275 t.Fatalf("testConfMap missing VolumeGroup:VolumeC.ReadCacheWeight=100") 276 } 277 278 testVolume, testVolumeOK = testConfMap["Volume:VolumeC"] 279 if !testVolumeOK { 280 t.Fatalf("testConfMap must contain a Volume:VolumeC section") 281 } 282 283 maxFlushSize, maxFlushSizeOK = testVolume["MaxFlushSize"] 284 if !maxFlushSizeOK || (1 != len(maxFlushSize)) || ("10000000" != maxFlushSize[0]) { 285 t.Fatalf("testConfMap missing Volume:VolumeC.MaxFlushSize=10000000") 286 } 287 maxFlushTime, maxFlushTimeOK = testVolume["MaxFlushTime"] 288 if !maxFlushTimeOK || (1 != len(maxFlushTime)) || ("10s" != maxFlushTime[0]) { 289 t.Fatalf("testConfMap missing Volume:VolumeC.MaxFlushTime=10s") 290 } 291 292 fileDefragmentChunkSize, fileDefragmentChunkSizeOK = testVolume["FileDefragmentChunkSize"] 293 if !fileDefragmentChunkSizeOK || (1 != len(fileDefragmentChunkSize)) || ("10000000" != fileDefragmentChunkSize[0]) { 294 t.Fatalf("testConfigMap has invalid Volume:VolumeC.FileDefragmentChunkSize") 295 } 296 fileDefragmentChunkDelay, fileDefragmentChunkDelayOK = testVolume["FileDefragmentChunkDelay"] 297 if !fileDefragmentChunkDelayOK || (1 != len(fileDefragmentChunkDelay)) || ("10ms" != fileDefragmentChunkDelay[0]) { 298 t.Fatalf("testConfigMap has invalid Volume:VolumeC.FileDefragmentChunkDelay") 299 } 300 301 // Validate VolumeGroup:V_VolumeD_G 302 303 testVolumeGroup, testVolumeGroupOK = testConfMap["VolumeGroup:V_VolumeD_G"] 304 if !testVolumeGroupOK { 305 t.Fatalf("testConfMap must contain a VolumeGroup:V_VolumeD_G section") 306 } 307 308 volumeList, volumeListOK = testVolumeGroup["VolumeList"] 309 if !volumeListOK || (1 != len(volumeList)) || ("VolumeD" != volumeList[0]) { 310 t.Fatalf("testConfMap missing VolumeGroup:VolumeD.VolumeList=VolumeD") 311 } 312 virtualIPAddr, virtualIPAddrOK = testVolumeGroup["VirtualIPAddr"] 313 if !virtualIPAddrOK || (0 != len(virtualIPAddr)) { 314 t.Fatalf("testConfMap missing VolumeGroup:VolumeD.VirtualIPAddr=") 315 } 316 primaryPeer, primaryPeerOK = testVolumeGroup["PrimaryPeer"] 317 if !primaryPeerOK || (1 != len(primaryPeer)) || ("Peer2" != primaryPeer[0]) { 318 t.Fatalf("testConfMap missing VolumeGroup:VolumeD.PrimaryPeer=Peer2") 319 } 320 readCacheLineSize, readCacheLineSizeOK = testVolumeGroup["ReadCacheLineSize"] 321 if !readCacheLineSizeOK || (1 != len(readCacheLineSize)) || ("2000000" != readCacheLineSize[0]) { 322 t.Fatalf("testConfMap missing VolumeGroup:VolumeD.ReadCacheLineSize=2000000") 323 } 324 readCacheWeight, readCacheWeightOK = testVolumeGroup["ReadCacheWeight"] 325 if !readCacheWeightOK || (1 != len(readCacheWeight)) || ("200" != readCacheWeight[0]) { 326 t.Fatalf("testConfMap missing VolumeGroup:VolumeD.ReadCacheWeight=200") 327 } 328 329 testVolume, testVolumeOK = testConfMap["Volume:VolumeD"] 330 if !testVolumeOK { 331 t.Fatalf("testConfMap must contain a Volume:VolumeD section") 332 } 333 334 maxFlushSize, maxFlushSizeOK = testVolume["MaxFlushSize"] 335 if !maxFlushSizeOK || (1 != len(maxFlushSize)) || ("20000000" != maxFlushSize[0]) { 336 t.Fatalf("testConfMap missing Volume:VolumeD.MaxFlushSize=20000000") 337 } 338 maxFlushTime, maxFlushTimeOK = testVolume["MaxFlushTime"] 339 if !maxFlushTimeOK || (1 != len(maxFlushTime)) || ("20s" != maxFlushTime[0]) { 340 t.Fatalf("testConfMap missing Volume:VolumeD.MaxFlushTime=20s") 341 } 342 343 fileDefragmentChunkSize, fileDefragmentChunkSizeOK = testVolume["FileDefragmentChunkSize"] 344 if !fileDefragmentChunkSizeOK || (1 != len(fileDefragmentChunkSize)) || ("20000000" != fileDefragmentChunkSize[0]) { 345 t.Fatalf("testConfigMap has invalid Volume:VolumeD.FileDefragmentChunkSize") 346 } 347 fileDefragmentChunkDelay, fileDefragmentChunkDelayOK = testVolume["FileDefragmentChunkDelay"] 348 if !fileDefragmentChunkDelayOK || (1 != len(fileDefragmentChunkDelay)) || ("20ms" != fileDefragmentChunkDelay[0]) { 349 t.Fatalf("testConfigMap has invalid Volume:VolumeD.FileDefragmentChunkDelay") 350 } 351 } 352 353 // testValidateCallbackLog compares the global testCallbackLog to the 354 // provided expectedCallbackLog. Note that testCallbackLog is a time 355 // ordered []string of log messages. It is expected that some have 356 // order dependency (e.g. one cannot destroy a volume unless it has 357 // been unserved if it was previously served by this peer). As such, 358 // the structure of expectedCallbackLog is a time ordered list of 359 // []string. Within each []string, order is not required...though each 360 // element must match precisely once. In the slice of []string's, order 361 // is strictly required. 362 // 363 func testValidateCallbackLog(t *testing.T, testcase string, expectedCallbackLog [][]string) { 364 var ( 365 expectedCallbackLogSliceElement []string 366 numLogMessages int 367 testCallbackLogIndex int 368 testCallbackLogSubset []string 369 testCallbackLogSubsetElement string 370 testCallbackLogSubsetIndex int 371 ) 372 // First ensure we have the expected number of log messages 373 374 numLogMessages = 0 375 376 for _, expectedCallbackLogSliceElement = range expectedCallbackLog { 377 numLogMessages += len(expectedCallbackLogSliceElement) 378 } 379 380 if len(testCallbackLog) != numLogMessages { 381 t.Fatalf("In testcase \"%s\", unexpected testCallbackLog", testcase) 382 } 383 384 testCallbackLogIndex = 0 385 386 for _, expectedCallbackLogSliceElement = range expectedCallbackLog { 387 testCallbackLogSubset = testCallbackLog[testCallbackLogIndex : testCallbackLogIndex+len(expectedCallbackLogSliceElement)] 388 389 sort.Strings(testCallbackLogSubset) 390 sort.Strings(expectedCallbackLogSliceElement) 391 392 for testCallbackLogSubsetIndex, testCallbackLogSubsetElement = range testCallbackLogSubset { 393 if testCallbackLogSubsetElement != expectedCallbackLogSliceElement[testCallbackLogSubsetIndex] { 394 t.Fatalf("In testcase \"%s\", unexpected testCallbackLog", testcase) 395 } 396 } 397 398 testCallbackLogIndex += len(testCallbackLogSubset) 399 } 400 } 401 402 func TestAPI(t *testing.T) { 403 var ( 404 err error 405 testCallbacksInterface1 *testCallbacksInterfaceStruct 406 testCallbacksInterface2 *testCallbacksInterfaceStruct 407 testConfMap conf.ConfMap 408 ) 409 410 testCallbacksInterface1 = &testCallbacksInterfaceStruct{name: "1", t: t} 411 testCallbacksInterface2 = &testCallbacksInterfaceStruct{name: "2", t: t} 412 413 Register(testCallbacksInterface1.name, testCallbacksInterface1) 414 Register(testCallbacksInterface2.name, testCallbacksInterface2) 415 416 testConfMap, err = conf.MakeConfMapFromStrings(testConfStrings) 417 if nil != err { 418 t.Fatalf("conf.MakeConfMapFromStrings() failed: %v", err) 419 } 420 421 t.Log("Verify old->new conf.ConfMap conversion") 422 423 err = upgradeConfMapIfNeeded(testConfMap) 424 if nil != err { 425 t.Fatalf("upgradeConfMapIfNeeded(<old confMap contents) failed: %v", err) 426 } 427 428 testValidateUpgradedConfMap(t, testConfMap) 429 430 err = upgradeConfMapIfNeeded(testConfMap) 431 if nil != err { 432 t.Fatalf("upgradeConfMapIfNeeded(<new confMap contents) failed: %v", err) 433 } 434 435 testValidateUpgradedConfMap(t, testConfMap) 436 437 t.Log("Perform Up() sequence") 438 439 testCallbackLog = make([]string, 0, 24) 440 441 err = Up(testConfMap) 442 if nil != err { 443 t.Fatalf("Up() failed: %v", err) 444 } 445 446 testValidateCallbackLog(t, 447 "Perform Up() sequence", 448 [][]string{ 449 []string{ 450 "testCallbacksInterface1.Up() called"}, 451 []string{ 452 "testCallbacksInterface2.Up() called"}, 453 []string{ 454 "testCallbacksInterface1.VolumeGroupCreated(,V_VolumeA_G,Peer0,) called", 455 "testCallbacksInterface1.VolumeGroupCreated(,V_VolumeB_G,Peer0,) called", 456 "testCallbacksInterface1.VolumeGroupCreated(,V_VolumeC_G,Peer1,) called", 457 "testCallbacksInterface1.VolumeGroupCreated(,V_VolumeD_G,Peer2,) called"}, 458 []string{ 459 "testCallbacksInterface2.VolumeGroupCreated(,V_VolumeA_G,Peer0,) called", 460 "testCallbacksInterface2.VolumeGroupCreated(,V_VolumeB_G,Peer0,) called", 461 "testCallbacksInterface2.VolumeGroupCreated(,V_VolumeC_G,Peer1,) called", 462 "testCallbacksInterface2.VolumeGroupCreated(,V_VolumeD_G,Peer2,) called"}, 463 []string{ 464 "testCallbacksInterface1.VolumeCreated(,VolumeA,V_VolumeA_G) called", 465 "testCallbacksInterface1.VolumeCreated(,VolumeB,V_VolumeB_G) called", 466 "testCallbacksInterface1.VolumeCreated(,VolumeC,V_VolumeC_G) called", 467 "testCallbacksInterface1.VolumeCreated(,VolumeD,V_VolumeD_G) called"}, 468 []string{ 469 "testCallbacksInterface2.VolumeCreated(,VolumeA,V_VolumeA_G) called", 470 "testCallbacksInterface2.VolumeCreated(,VolumeB,V_VolumeB_G) called", 471 "testCallbacksInterface2.VolumeCreated(,VolumeC,V_VolumeC_G) called", 472 "testCallbacksInterface2.VolumeCreated(,VolumeD,V_VolumeD_G) called"}, 473 []string{ 474 "testCallbacksInterface1.ServeVolume(,VolumeA) called", 475 "testCallbacksInterface1.ServeVolume(,VolumeB) called"}, 476 []string{ 477 "testCallbacksInterface2.ServeVolume(,VolumeA) called", 478 "testCallbacksInterface2.ServeVolume(,VolumeB) called"}, 479 []string{ 480 "testCallbacksInterface1.SignaledFinish() called"}, 481 []string{ 482 "testCallbacksInterface2.SignaledFinish() called"}, 483 }) 484 485 t.Log("Perform Signaled() sequence with no changes") 486 487 testCallbackLog = make([]string, 0, 4) 488 489 err = Signaled(testConfMap) 490 if nil != err { 491 t.Fatalf("Signaled() failed: %v", err) 492 } 493 494 testValidateCallbackLog(t, 495 "Perform Signaled() sequence with no changes", 496 [][]string{ 497 []string{ 498 "testCallbacksInterface2.SignaledStart() called"}, 499 []string{ 500 "testCallbacksInterface1.SignaledStart() called"}, 501 []string{ 502 "testCallbacksInterface1.SignaledFinish() called"}, 503 []string{ 504 "testCallbacksInterface2.SignaledFinish() called"}}) 505 506 t.Log("Move VolumeB from Peer0 to Peer1") 507 508 testConfMap["VolumeGroup:V_VolumeB_G"]["PrimaryPeer"] = []string{"Peer1"} 509 510 testCallbackLog = make([]string, 0, 8) 511 512 err = Signaled(testConfMap) 513 if nil != err { 514 t.Fatalf("Signaled() failed: %v", err) 515 } 516 517 testValidateCallbackLog(t, 518 "Move VolumeB from Peer0 to Peer1", 519 [][]string{ 520 []string{ 521 "testCallbacksInterface2.VolumeToBeUnserved(,VolumeB) called"}, 522 []string{ 523 "testCallbacksInterface1.VolumeToBeUnserved(,VolumeB) called"}, 524 []string{ 525 "testCallbacksInterface2.SignaledStart() called"}, 526 []string{ 527 "testCallbacksInterface1.SignaledStart() called"}, 528 []string{ 529 "testCallbacksInterface2.UnserveVolume(,VolumeB) called"}, 530 []string{ 531 "testCallbacksInterface1.UnserveVolume(,VolumeB) called"}, 532 []string{ 533 "testCallbacksInterface1.VolumeGroupMoved(,V_VolumeB_G,Peer1,) called"}, 534 []string{ 535 "testCallbacksInterface2.VolumeGroupMoved(,V_VolumeB_G,Peer1,) called"}, 536 []string{ 537 "testCallbacksInterface1.SignaledFinish() called"}, 538 []string{ 539 "testCallbacksInterface2.SignaledFinish() called"}}) 540 541 t.Log("Move VolumeC from Peer1 to Peer2") 542 543 testConfMap["VolumeGroup:V_VolumeC_G"]["PrimaryPeer"] = []string{"Peer2"} 544 545 testCallbackLog = make([]string, 0, 6) 546 547 err = Signaled(testConfMap) 548 if nil != err { 549 t.Fatalf("Signaled() failed: %v", err) 550 } 551 552 testValidateCallbackLog(t, 553 "Move VolumeC from Peer1 to Peer2", 554 [][]string{ 555 []string{ 556 "testCallbacksInterface2.SignaledStart() called"}, 557 []string{ 558 "testCallbacksInterface1.SignaledStart() called"}, 559 []string{ 560 "testCallbacksInterface1.VolumeGroupMoved(,V_VolumeC_G,Peer2,) called"}, 561 []string{ 562 "testCallbacksInterface2.VolumeGroupMoved(,V_VolumeC_G,Peer2,) called"}, 563 []string{ 564 "testCallbacksInterface1.SignaledFinish() called"}, 565 []string{ 566 "testCallbacksInterface2.SignaledFinish() called"}}) 567 568 t.Log("Destroy VolumeC") 569 570 testConfMap["FSGlobals"]["VolumeGroupList"] = []string{"V_VolumeA_G", "V_VolumeB_G", "V_VolumeD_G"} 571 572 delete(testConfMap, "VolumeGroup:V_VolumeC_G") 573 delete(testConfMap, "Volume:VolumeC") 574 575 testCallbackLog = make([]string, 0, 8) 576 577 err = Signaled(testConfMap) 578 if nil != err { 579 t.Fatalf("Signaled() failed: %v", err) 580 } 581 582 testValidateCallbackLog(t, 583 "Destroy VolumeC", 584 [][]string{ 585 []string{ 586 "testCallbacksInterface2.SignaledStart() called"}, 587 []string{ 588 "testCallbacksInterface1.SignaledStart() called"}, 589 []string{ 590 "testCallbacksInterface2.VolumeDestroyed(,VolumeC) called"}, 591 []string{ 592 "testCallbacksInterface1.VolumeDestroyed(,VolumeC) called"}, 593 []string{ 594 "testCallbacksInterface2.VolumeGroupDestroyed(,V_VolumeC_G) called"}, 595 []string{ 596 "testCallbacksInterface1.VolumeGroupDestroyed(,V_VolumeC_G) called"}, 597 []string{ 598 "testCallbacksInterface1.SignaledFinish() called"}, 599 []string{ 600 "testCallbacksInterface2.SignaledFinish() called"}}) 601 602 t.Log("Move VolumeD from Peer2 to Peer0") 603 604 testConfMap["VolumeGroup:V_VolumeD_G"]["PrimaryPeer"] = []string{"Peer0"} 605 606 testCallbackLog = make([]string, 0, 8) 607 608 err = Signaled(testConfMap) 609 if nil != err { 610 t.Fatalf("Signaled() failed: %v", err) 611 } 612 613 testValidateCallbackLog(t, 614 "Move VolumeD from Peer2 to Peer0", 615 [][]string{ 616 []string{ 617 "testCallbacksInterface2.SignaledStart() called"}, 618 []string{ 619 "testCallbacksInterface1.SignaledStart() called"}, 620 []string{ 621 "testCallbacksInterface1.VolumeGroupMoved(,V_VolumeD_G,Peer0,) called"}, 622 []string{ 623 "testCallbacksInterface2.VolumeGroupMoved(,V_VolumeD_G,Peer0,) called"}, 624 []string{ 625 "testCallbacksInterface1.ServeVolume(,VolumeD) called"}, 626 []string{ 627 "testCallbacksInterface2.ServeVolume(,VolumeD) called"}, 628 []string{ 629 "testCallbacksInterface1.SignaledFinish() called"}, 630 []string{ 631 "testCallbacksInterface2.SignaledFinish() called"}}) 632 633 t.Log("Destroy VolumeD") 634 635 testConfMap["FSGlobals"]["VolumeGroupList"] = []string{"V_VolumeA_G", "V_VolumeB_G"} 636 637 delete(testConfMap, "VolumeGroup:V_VolumeD_G") 638 delete(testConfMap, "Volume:VolumeD") 639 640 testCallbackLog = make([]string, 0, 10) 641 642 err = Signaled(testConfMap) 643 if nil != err { 644 t.Fatalf("Signaled() failed: %v", err) 645 } 646 647 testValidateCallbackLog(t, 648 "Destroy VolumeD", 649 [][]string{ 650 []string{ 651 "testCallbacksInterface2.VolumeToBeUnserved(,VolumeD) called"}, 652 []string{ 653 "testCallbacksInterface1.VolumeToBeUnserved(,VolumeD) called"}, 654 []string{ 655 "testCallbacksInterface2.SignaledStart() called"}, 656 []string{ 657 "testCallbacksInterface1.SignaledStart() called"}, 658 []string{ 659 "testCallbacksInterface2.UnserveVolume(,VolumeD) called"}, 660 []string{ 661 "testCallbacksInterface1.UnserveVolume(,VolumeD) called"}, 662 []string{ 663 "testCallbacksInterface2.VolumeDestroyed(,VolumeD) called"}, 664 []string{ 665 "testCallbacksInterface1.VolumeDestroyed(,VolumeD) called"}, 666 []string{ 667 "testCallbacksInterface2.VolumeGroupDestroyed(,V_VolumeD_G) called"}, 668 []string{ 669 "testCallbacksInterface1.VolumeGroupDestroyed(,V_VolumeD_G) called"}, 670 []string{ 671 "testCallbacksInterface1.SignaledFinish() called"}, 672 []string{ 673 "testCallbacksInterface2.SignaledFinish() called"}}) 674 675 t.Log("Create VolumeE on Peer0") 676 677 err = testConfMap.UpdateFromStrings(testConfStringsToAddVolumeE) 678 if nil != err { 679 t.Fatalf("testConfMap.UpdateFromStrings(testConfStringsToAddVolumeE) failed: %v", err) 680 } 681 682 testCallbackLog = make([]string, 0, 10) 683 684 err = Signaled(testConfMap) 685 if nil != err { 686 t.Fatalf("Signaled() failed: %v", err) 687 } 688 689 testValidateCallbackLog(t, 690 "Create VolumeE on Peer0", 691 [][]string{ 692 []string{ 693 "testCallbacksInterface2.SignaledStart() called"}, 694 []string{ 695 "testCallbacksInterface1.SignaledStart() called"}, 696 []string{ 697 "testCallbacksInterface1.VolumeGroupCreated(,VG_One,Peer0,) called"}, 698 []string{ 699 "testCallbacksInterface2.VolumeGroupCreated(,VG_One,Peer0,) called"}, 700 []string{ 701 "testCallbacksInterface1.VolumeCreated(,VolumeE,VG_One) called"}, 702 []string{ 703 "testCallbacksInterface2.VolumeCreated(,VolumeE,VG_One) called"}, 704 []string{ 705 "testCallbacksInterface1.ServeVolume(,VolumeE) called"}, 706 []string{ 707 "testCallbacksInterface2.ServeVolume(,VolumeE) called"}, 708 []string{ 709 "testCallbacksInterface1.SignaledFinish() called"}, 710 []string{ 711 "testCallbacksInterface2.SignaledFinish() called"}}) 712 713 t.Log("Create VolumeF on Peer1") 714 715 err = testConfMap.UpdateFromStrings(testConfStringsToAddVolumeF) 716 if nil != err { 717 t.Fatalf("testConfMap.UpdateFromStrings(testConfStringsToAddVolumeF) failed: %v", err) 718 } 719 720 testCallbackLog = make([]string, 0, 8) 721 722 err = Signaled(testConfMap) 723 if nil != err { 724 t.Fatalf("Signaled() failed: %v", err) 725 } 726 727 testValidateCallbackLog(t, 728 "Create VolumeF on Peer1", 729 [][]string{ 730 []string{ 731 "testCallbacksInterface2.SignaledStart() called"}, 732 []string{ 733 "testCallbacksInterface1.SignaledStart() called"}, 734 []string{ 735 "testCallbacksInterface1.VolumeGroupCreated(,VG_Two,Peer1,) called"}, 736 []string{ 737 "testCallbacksInterface2.VolumeGroupCreated(,VG_Two,Peer1,) called"}, 738 []string{ 739 "testCallbacksInterface1.VolumeCreated(,VolumeF,VG_Two) called"}, 740 []string{ 741 "testCallbacksInterface2.VolumeCreated(,VolumeF,VG_Two) called"}, 742 []string{ 743 "testCallbacksInterface1.SignaledFinish() called"}, 744 []string{ 745 "testCallbacksInterface2.SignaledFinish() called"}}) 746 747 t.Log("Create VolumeG on Peer2") 748 749 err = testConfMap.UpdateFromStrings(testConfStringsToAddVolumeG) 750 if nil != err { 751 t.Fatalf("testConfMap.UpdateFromStrings(testConfStringsToAddVolumeG) failed: %v", err) 752 } 753 754 testCallbackLog = make([]string, 0, 8) 755 756 err = Signaled(testConfMap) 757 if nil != err { 758 t.Fatalf("Signaled() failed: %v", err) 759 } 760 761 testValidateCallbackLog(t, 762 "Create VolumeG on Peer2", 763 [][]string{ 764 []string{ 765 "testCallbacksInterface2.SignaledStart() called"}, 766 []string{ 767 "testCallbacksInterface1.SignaledStart() called"}, 768 []string{ 769 "testCallbacksInterface1.VolumeGroupCreated(,VG_Three,Peer2,) called"}, 770 []string{ 771 "testCallbacksInterface2.VolumeGroupCreated(,VG_Three,Peer2,) called"}, 772 []string{ 773 "testCallbacksInterface1.VolumeCreated(,VolumeG,VG_Three) called"}, 774 []string{ 775 "testCallbacksInterface2.VolumeCreated(,VolumeG,VG_Three) called"}, 776 []string{ 777 "testCallbacksInterface1.SignaledFinish() called"}, 778 []string{ 779 "testCallbacksInterface2.SignaledFinish() called"}}) 780 781 t.Log("Move VolumeG to VolumeF's VolumeGroup") 782 783 err = testConfMap.UpdateFromStrings(testConfStringsToMoveVolumeG) 784 if nil != err { 785 t.Fatalf("testConfMap.UpdateFromStrings(testConfStringsToMoveVolumeG) failed: %v", err) 786 } 787 788 testCallbackLog = make([]string, 0, 6) 789 790 err = Signaled(testConfMap) 791 if nil != err { 792 t.Fatalf("Signaled() failed: %v", err) 793 } 794 795 testValidateCallbackLog(t, 796 "Move VolumeG to VolumeF's VolumeGroup", 797 [][]string{ 798 []string{ 799 "testCallbacksInterface2.SignaledStart() called"}, 800 []string{ 801 "testCallbacksInterface1.SignaledStart() called"}, 802 []string{ 803 "testCallbacksInterface1.VolumeMoved(,VolumeG,VG_Two) called"}, 804 []string{ 805 "testCallbacksInterface2.VolumeMoved(,VolumeG,VG_Two) called"}, 806 []string{ 807 "testCallbacksInterface1.SignaledFinish() called"}, 808 []string{ 809 "testCallbacksInterface2.SignaledFinish() called"}}) 810 811 t.Log("Perform Down() sequence") 812 813 testCallbackLog = make([]string, 0, 28) 814 815 err = Down(testConfMap) 816 if nil != err { 817 t.Fatalf("Down() failed: %v", err) 818 } 819 820 testValidateCallbackLog(t, 821 "Perform Down() sequence", 822 [][]string{ 823 []string{ 824 "testCallbacksInterface2.VolumeToBeUnserved(,VolumeA) called", 825 "testCallbacksInterface2.VolumeToBeUnserved(,VolumeE) called"}, 826 []string{ 827 "testCallbacksInterface1.VolumeToBeUnserved(,VolumeA) called", 828 "testCallbacksInterface1.VolumeToBeUnserved(,VolumeE) called"}, 829 []string{ 830 "testCallbacksInterface2.SignaledStart() called"}, 831 []string{ 832 "testCallbacksInterface1.SignaledStart() called"}, 833 []string{ 834 "testCallbacksInterface2.UnserveVolume(,VolumeA) called", 835 "testCallbacksInterface2.UnserveVolume(,VolumeE) called"}, 836 []string{ 837 "testCallbacksInterface1.UnserveVolume(,VolumeA) called", 838 "testCallbacksInterface1.UnserveVolume(,VolumeE) called"}, 839 []string{ 840 "testCallbacksInterface2.VolumeDestroyed(,VolumeA) called", 841 "testCallbacksInterface2.VolumeDestroyed(,VolumeB) called", 842 "testCallbacksInterface2.VolumeDestroyed(,VolumeE) called", 843 "testCallbacksInterface2.VolumeDestroyed(,VolumeF) called", 844 "testCallbacksInterface2.VolumeDestroyed(,VolumeG) called"}, 845 []string{ 846 "testCallbacksInterface1.VolumeDestroyed(,VolumeA) called", 847 "testCallbacksInterface1.VolumeDestroyed(,VolumeB) called", 848 "testCallbacksInterface1.VolumeDestroyed(,VolumeE) called", 849 "testCallbacksInterface1.VolumeDestroyed(,VolumeF) called", 850 "testCallbacksInterface1.VolumeDestroyed(,VolumeG) called"}, 851 []string{ 852 "testCallbacksInterface2.VolumeGroupDestroyed(,V_VolumeA_G) called", 853 "testCallbacksInterface2.VolumeGroupDestroyed(,V_VolumeB_G) called", 854 "testCallbacksInterface2.VolumeGroupDestroyed(,VG_One) called", 855 "testCallbacksInterface2.VolumeGroupDestroyed(,VG_Two) called", 856 "testCallbacksInterface2.VolumeGroupDestroyed(,VG_Three) called"}, 857 []string{ 858 "testCallbacksInterface1.VolumeGroupDestroyed(,V_VolumeA_G) called", 859 "testCallbacksInterface1.VolumeGroupDestroyed(,V_VolumeB_G) called", 860 "testCallbacksInterface1.VolumeGroupDestroyed(,VG_One) called", 861 "testCallbacksInterface1.VolumeGroupDestroyed(,VG_Two) called", 862 "testCallbacksInterface1.VolumeGroupDestroyed(,VG_Three) called"}, 863 []string{ 864 "testCallbacksInterface2.Down() called"}, 865 []string{ 866 "testCallbacksInterface1.Down() called"}}) 867 } 868 869 func (testCallbacksInterface *testCallbacksInterfaceStruct) Up(confMap conf.ConfMap) (err error) { 870 logMessage := fmt.Sprintf("testCallbacksInterface%s.Up() called", testCallbacksInterface.name) 871 testCallbacksInterface.t.Logf(" %s", logMessage) 872 testCallbackLog = append(testCallbackLog, logMessage) 873 return nil 874 } 875 876 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeGroupCreated(confMap conf.ConfMap, volumeGroupName string, activePeer string, virtualIPAddr string) (err error) { 877 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeGroupCreated(,%s,%s,%s) called", testCallbacksInterface.name, volumeGroupName, activePeer, virtualIPAddr) 878 testCallbacksInterface.t.Logf(" %s", logMessage) 879 testCallbackLog = append(testCallbackLog, logMessage) 880 return nil 881 } 882 883 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeGroupMoved(confMap conf.ConfMap, volumeGroupName string, activePeer string, virtualIPAddr string) (err error) { 884 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeGroupMoved(,%s,%s,%s) called", testCallbacksInterface.name, volumeGroupName, activePeer, virtualIPAddr) 885 testCallbacksInterface.t.Logf(" %s", logMessage) 886 testCallbackLog = append(testCallbackLog, logMessage) 887 return nil 888 } 889 890 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeGroupDestroyed(confMap conf.ConfMap, volumeGroupName string) (err error) { 891 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeGroupDestroyed(,%s) called", testCallbacksInterface.name, volumeGroupName) 892 testCallbacksInterface.t.Logf(" %s", logMessage) 893 testCallbackLog = append(testCallbackLog, logMessage) 894 return nil 895 } 896 897 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeCreated(confMap conf.ConfMap, volumeName string, volumeGroupName string) (err error) { 898 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeCreated(,%s,%s) called", testCallbacksInterface.name, volumeName, volumeGroupName) 899 testCallbacksInterface.t.Logf(" %s", logMessage) 900 testCallbackLog = append(testCallbackLog, logMessage) 901 return nil 902 } 903 904 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeMoved(confMap conf.ConfMap, volumeName string, volumeGroupName string) (err error) { 905 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeMoved(,%s,%s) called", testCallbacksInterface.name, volumeName, volumeGroupName) 906 testCallbacksInterface.t.Logf(" %s", logMessage) 907 testCallbackLog = append(testCallbackLog, logMessage) 908 return nil 909 } 910 911 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeDestroyed(confMap conf.ConfMap, volumeName string) (err error) { 912 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeDestroyed(,%s) called", testCallbacksInterface.name, volumeName) 913 testCallbacksInterface.t.Logf(" %s", logMessage) 914 testCallbackLog = append(testCallbackLog, logMessage) 915 return nil 916 } 917 918 func (testCallbacksInterface *testCallbacksInterfaceStruct) ServeVolume(confMap conf.ConfMap, volumeName string) (err error) { 919 logMessage := fmt.Sprintf("testCallbacksInterface%s.ServeVolume(,%s) called", testCallbacksInterface.name, volumeName) 920 testCallbacksInterface.t.Logf(" %s", logMessage) 921 testCallbackLog = append(testCallbackLog, logMessage) 922 return nil 923 } 924 925 func (testCallbacksInterface *testCallbacksInterfaceStruct) UnserveVolume(confMap conf.ConfMap, volumeName string) (err error) { 926 logMessage := fmt.Sprintf("testCallbacksInterface%s.UnserveVolume(,%s) called", testCallbacksInterface.name, volumeName) 927 testCallbacksInterface.t.Logf(" %s", logMessage) 928 testCallbackLog = append(testCallbackLog, logMessage) 929 return nil 930 } 931 932 func (testCallbacksInterface *testCallbacksInterfaceStruct) VolumeToBeUnserved(confMap conf.ConfMap, volumeName string) (err error) { 933 logMessage := fmt.Sprintf("testCallbacksInterface%s.VolumeToBeUnserved(,%s) called", testCallbacksInterface.name, volumeName) 934 testCallbacksInterface.t.Logf(" %s", logMessage) 935 testCallbackLog = append(testCallbackLog, logMessage) 936 return nil 937 } 938 939 func (testCallbacksInterface *testCallbacksInterfaceStruct) SignaledStart(confMap conf.ConfMap) (err error) { 940 logMessage := fmt.Sprintf("testCallbacksInterface%s.SignaledStart() called", testCallbacksInterface.name) 941 testCallbacksInterface.t.Logf(" %s", logMessage) 942 testCallbackLog = append(testCallbackLog, logMessage) 943 return nil 944 } 945 946 func (testCallbacksInterface *testCallbacksInterfaceStruct) SignaledFinish(confMap conf.ConfMap) (err error) { 947 logMessage := fmt.Sprintf("testCallbacksInterface%s.SignaledFinish() called", testCallbacksInterface.name) 948 testCallbacksInterface.t.Logf(" %s", logMessage) 949 testCallbackLog = append(testCallbackLog, logMessage) 950 return nil 951 } 952 953 func (testCallbacksInterface *testCallbacksInterfaceStruct) Down(confMap conf.ConfMap) (err error) { 954 logMessage := fmt.Sprintf("testCallbacksInterface%s.Down() called", testCallbacksInterface.name) 955 testCallbacksInterface.t.Logf(" %s", logMessage) 956 testCallbackLog = append(testCallbackLog, logMessage) 957 return nil 958 }