Make unit testable cert parsing functions. (#3863)

This commit is contained in:
Bala FA
2017-03-09 08:50:01 +05:30
committed by Harshavardhana
parent 47ac410ab0
commit 8a9852220d
9 changed files with 420 additions and 245 deletions

View File

@@ -66,7 +66,7 @@ func TestServerConfigMigrateInexistentConfig(t *testing.T) {
defer removeAll(rootPath)
setConfigDir(rootPath)
configPath := rootPath + "/" + globalMinioConfigFile
configPath := rootPath + "/" + minioConfigFile
// Remove config file
if err := os.Remove(configPath); err != nil {
@@ -121,7 +121,7 @@ func TestServerConfigMigrateV2toV14(t *testing.T) {
defer removeAll(rootPath)
setConfigDir(rootPath)
configPath := rootPath + "/" + globalMinioConfigFile
configPath := rootPath + "/" + minioConfigFile
// Create a corrupted config file
if err := ioutil.WriteFile(configPath, []byte("{ \"version\":\"2\","), 0644); err != nil {
@@ -175,7 +175,7 @@ func TestServerConfigMigrateFaultyConfig(t *testing.T) {
defer removeAll(rootPath)
setConfigDir(rootPath)
configPath := rootPath + "/" + globalMinioConfigFile
configPath := rootPath + "/" + minioConfigFile
// Create a corrupted config file
if err := ioutil.WriteFile(configPath, []byte("{ \"version\":\""), 0644); err != nil {