-
Notifications
You must be signed in to change notification settings - Fork 1
/
funcSetTimeToRestartThisContainerAfterStopEventOnChaosScene.go
57 lines (55 loc) · 2.34 KB
/
funcSetTimeToRestartThisContainerAfterStopEventOnChaosScene.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package iotmakerdockerbuilder
import "time"
// SetTimeToRestartThisContainerAfterStopEventOnChaosScene
//
// English
//
// Defines the minimum and maximum times to restart the container after the container stop event.
//
// Input:
// min: minimum timeout before restarting container
// max: maximum timeout before restarting container
//
// Note:
//
// * The following functions are used together during chaos testing:
// [optional] iotmakerdockerbuilder.ConfigChaosScene()
//
// Mandatory set:
// ContainerBuilder.EnableChaosScene()
// ContainerBuilder.SetTimeOnContainerUnpausedStateOnChaosScene()
// ContainerBuilder.SetTimeToStartChaosOnChaosScene()
// ContainerBuilder.SetTimeToRestartThisContainerAfterStopEventOnChaosScene()
// ContainerBuilder.SetTimeOnContainerPausedStateOnChaosScene()
// ContainerBuilder.SetTimeBeforeStartChaosInThisContainerOnChaosScene()
// ContainerBuilder.SetSceneNameOnChaosScene()
// [optional] ContainerBuilder.ContainerSetDisabePauseOnChaosScene()
// [optional] ContainerBuilder.ContainerSetDisabeStopOnChaosScene()
//
// Português:
//
// Define os tempos mínimos e máximos para reiniciar o container após o evento de parar container.
//
// Entrada:
// min: tempo mínimo de espera antes de reiniciar o container
// max: tempo máximo de espera antes de reiniciar o container
//
// Nota:
//
// * As funções a seguir são usadas em conjunto durante o teste de caos:
// [opcional] iotmakerdockerbuilder.ConfigChaosScene()
//
// Conjunto obrigatório:
// ContainerBuilder.EnableChaosScene()
// ContainerBuilder.SetTimeOnContainerUnpausedStateOnChaosScene()
// ContainerBuilder.SetTimeToStartChaosOnChaosScene()
// ContainerBuilder.SetTimeToRestartThisContainerAfterStopEventOnChaosScene()
// ContainerBuilder.SetTimeOnContainerPausedStateOnChaosScene()
// ContainerBuilder.SetTimeBeforeStartChaosInThisContainerOnChaosScene()
// ContainerBuilder.SetSceneNameOnChaosScene()
// [opcional] ContainerBuilder.ContainerSetDisabePauseOnChaosScene()
// [opcional] ContainerBuilder.ContainerSetDisabeStopOnChaosScene()
func (e *ContainerBuilder) SetTimeToRestartThisContainerAfterStopEventOnChaosScene(min, max time.Duration) {
e.chaos.minimumTimeToRestart = min
e.chaos.maximumTimeToRestart = max
}