mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	OSS parts of sighup license reload test (#11816)
This commit is contained in:
		| @@ -103,6 +103,7 @@ type ServerCommand struct { | ||||
| 	reloadFuncs       *map[string][]reloadutil.ReloadFunc | ||||
| 	startedCh         chan (struct{}) // for tests | ||||
| 	reloadedCh        chan (struct{}) // for tests | ||||
| 	licenseReloadedCh chan (error)    // for tests | ||||
|  | ||||
| 	allLoggers []log.Logger | ||||
|  | ||||
| @@ -1564,8 +1565,13 @@ func (c *ServerCommand) Run(args []string) int { | ||||
| 			} | ||||
|  | ||||
| 			// Reload license file | ||||
| 			if err := vault.LicenseReload(core); err != nil { | ||||
| 				c.UI.Error(fmt.Sprintf("Error reloading license: %v", err)) | ||||
| 			if err = vault.LicenseReload(core); err != nil { | ||||
| 				c.UI.Error(err.Error()) | ||||
| 			} | ||||
|  | ||||
| 			select { | ||||
| 			case c.licenseReloadedCh <- err: | ||||
| 			default: | ||||
| 			} | ||||
|  | ||||
| 		case <-c.SigUSR2Ch: | ||||
|   | ||||
| @@ -98,6 +98,7 @@ func testServerCommand(tb testing.TB) (*cli.MockUi, *ServerCommand) { | ||||
| 		// These prevent us from random sleep guessing... | ||||
| 		startedCh:         make(chan struct{}, 5), | ||||
| 		reloadedCh:        make(chan struct{}, 5), | ||||
| 		licenseReloadedCh: make(chan error), | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Josh Black
					Josh Black