mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 06:31:10 +01:00
OSS parts of sighup license reload test (#11816)
This commit is contained in:
parent
3a333b9902
commit
38b6271de1
@ -99,10 +99,11 @@ type ServerCommand struct {
|
|||||||
|
|
||||||
cleanupGuard sync.Once
|
cleanupGuard sync.Once
|
||||||
|
|
||||||
reloadFuncsLock *sync.RWMutex
|
reloadFuncsLock *sync.RWMutex
|
||||||
reloadFuncs *map[string][]reloadutil.ReloadFunc
|
reloadFuncs *map[string][]reloadutil.ReloadFunc
|
||||||
startedCh chan (struct{}) // for tests
|
startedCh chan (struct{}) // for tests
|
||||||
reloadedCh chan (struct{}) // for tests
|
reloadedCh chan (struct{}) // for tests
|
||||||
|
licenseReloadedCh chan (error) // for tests
|
||||||
|
|
||||||
allLoggers []log.Logger
|
allLoggers []log.Logger
|
||||||
|
|
||||||
@ -1564,8 +1565,13 @@ func (c *ServerCommand) Run(args []string) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reload license file
|
// Reload license file
|
||||||
if err := vault.LicenseReload(core); err != nil {
|
if err = vault.LicenseReload(core); err != nil {
|
||||||
c.UI.Error(fmt.Sprintf("Error reloading license: %v", err))
|
c.UI.Error(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
case c.licenseReloadedCh <- err:
|
||||||
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-c.SigUSR2Ch:
|
case <-c.SigUSR2Ch:
|
||||||
|
|||||||
@ -96,8 +96,9 @@ func testServerCommand(tb testing.TB) (*cli.MockUi, *ServerCommand) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// These prevent us from random sleep guessing...
|
// These prevent us from random sleep guessing...
|
||||||
startedCh: make(chan struct{}, 5),
|
startedCh: make(chan struct{}, 5),
|
||||||
reloadedCh: make(chan struct{}, 5),
|
reloadedCh: make(chan struct{}, 5),
|
||||||
|
licenseReloadedCh: make(chan error),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user