mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 10:37:56 +00:00 
			
		
		
		
	Fix nightly tests and debug (#14970)
* adding env var * add fixes * fixing debug * removing umask from tests
This commit is contained in:
		| @@ -12,13 +12,13 @@ import ( | |||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"strings" | 	"strings" | ||||||
| 	"sync" | 	"sync" | ||||||
| 	"syscall" |  | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
| 	"github.com/hashicorp/go-hclog" | 	"github.com/hashicorp/go-hclog" | ||||||
| 	"github.com/hashicorp/go-secure-stdlib/gatedwriter" | 	"github.com/hashicorp/go-secure-stdlib/gatedwriter" | ||||||
| 	"github.com/hashicorp/go-secure-stdlib/strutil" | 	"github.com/hashicorp/go-secure-stdlib/strutil" | ||||||
| 	"github.com/hashicorp/vault/api" | 	"github.com/hashicorp/vault/api" | ||||||
|  | 	"github.com/hashicorp/vault/helper/osutil" | ||||||
| 	"github.com/hashicorp/vault/sdk/helper/jsonutil" | 	"github.com/hashicorp/vault/sdk/helper/jsonutil" | ||||||
| 	"github.com/hashicorp/vault/sdk/helper/logging" | 	"github.com/hashicorp/vault/sdk/helper/logging" | ||||||
| 	"github.com/hashicorp/vault/sdk/version" | 	"github.com/hashicorp/vault/sdk/version" | ||||||
| @@ -963,7 +963,7 @@ func (c *DebugCommand) persistCollection(collection []map[string]interface{}, ou | |||||||
|  |  | ||||||
| func (c *DebugCommand) compress(dst string) error { | func (c *DebugCommand) compress(dst string) error { | ||||||
| 	if runtime.GOOS != "windows" { | 	if runtime.GOOS != "windows" { | ||||||
| 		defer syscall.Umask(syscall.Umask(0o077)) | 		defer osutil.Umask(osutil.Umask(0o077)) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	tgz := archiver.NewTarGz() | 	tgz := archiver.NewTarGz() | ||||||
|   | |||||||
| @@ -18,6 +18,7 @@ import ( | |||||||
| 	"testing" | 	"testing" | ||||||
| 	"time" | 	"time" | ||||||
|  |  | ||||||
|  | 	"github.com/hashicorp/vault/sdk/helper/consts" | ||||||
| 	"github.com/hashicorp/vault/sdk/physical" | 	"github.com/hashicorp/vault/sdk/physical" | ||||||
| 	physInmem "github.com/hashicorp/vault/sdk/physical/inmem" | 	physInmem "github.com/hashicorp/vault/sdk/physical/inmem" | ||||||
| 	"github.com/mitchellh/cli" | 	"github.com/mitchellh/cli" | ||||||
| @@ -115,7 +116,7 @@ func TestServer_ReloadListener(t *testing.T) { | |||||||
| 	defer os.RemoveAll(td) | 	defer os.RemoveAll(td) | ||||||
|  |  | ||||||
| 	wg := &sync.WaitGroup{} | 	wg := &sync.WaitGroup{} | ||||||
|  | 	os.Setenv(consts.VaultDisableFilePermissionsCheckEnv, "true") | ||||||
| 	// Setup initial certs | 	// Setup initial certs | ||||||
| 	inBytes, _ := ioutil.ReadFile(wd + "reload_foo.pem") | 	inBytes, _ := ioutil.ReadFile(wd + "reload_foo.pem") | ||||||
| 	ioutil.WriteFile(td+"/reload_cert.pem", inBytes, 0o777) | 	ioutil.WriteFile(td+"/reload_cert.pem", inBytes, 0o777) | ||||||
|   | |||||||
| @@ -51,3 +51,8 @@ func FileUidMatch(info fs.FileInfo, path string, uid int) (err error) { | |||||||
| 	} | 	} | ||||||
| 	return err | 	return err | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // Sets new umask and returns old umask | ||||||
|  | func Umask(newmask int) int { | ||||||
|  | 	return syscall.Umask(newmask) | ||||||
|  | } | ||||||
|   | |||||||
| @@ -9,3 +9,8 @@ import ( | |||||||
| func FileUidMatch(info fs.FileInfo, path string, uid int) error { | func FileUidMatch(info fs.FileInfo, path string, uid int) error { | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // Umask does nothing for windows for now | ||||||
|  | func Umask(newmask int) int { | ||||||
|  | 	return 0 | ||||||
|  | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 akshya96
					akshya96