diff --git a/core/chaincode/platforms/car/test/platform_test.go b/core/chaincode/platforms/car/test/platform_test.go index c0abc22b99f..dfc7a45b364 100644 --- a/core/chaincode/platforms/car/test/platform_test.go +++ b/core/chaincode/platforms/car/test/platform_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/hyperledger/fabric/common/util" - "github.com/hyperledger/fabric/core/config" "github.com/hyperledger/fabric/core/container" + "github.com/hyperledger/fabric/core/testutil" pb "github.com/hyperledger/fabric/protos/peer" ) func TestMain(m *testing.M) { - config.SetupTestConfig("../../../../../peer") + testutil.SetupTestConfig("../../../../../peer") os.Exit(m.Run()) } diff --git a/core/chaincode/platforms/java/test/java_test.go b/core/chaincode/platforms/java/test/java_test.go index 36dcbd11b0f..0db93e97e6c 100644 --- a/core/chaincode/platforms/java/test/java_test.go +++ b/core/chaincode/platforms/java/test/java_test.go @@ -21,13 +21,13 @@ import ( "testing" "github.com/hyperledger/fabric/common/util" - "github.com/hyperledger/fabric/core/config" "github.com/hyperledger/fabric/core/container" + "github.com/hyperledger/fabric/core/testutil" pb "github.com/hyperledger/fabric/protos/peer" ) func TestMain(m *testing.M) { - config.SetupTestConfig("../../../../../peer") + testutil.SetupTestConfig("../../../../../peer") os.Exit(m.Run()) } diff --git a/core/comm/connection_test.go b/core/comm/connection_test.go index ac56e48085b..3f04a248e75 100644 --- a/core/comm/connection_test.go +++ b/core/comm/connection_test.go @@ -24,7 +24,7 @@ import ( "github.com/spf13/viper" - "github.com/hyperledger/fabric/core/config" + "github.com/hyperledger/fabric/core/testutil" "github.com/stretchr/testify/assert" "google.golang.org/grpc" ) @@ -52,7 +52,7 @@ VQQLDAtIeXBlcmxlZGdlcjESMBAGA1UEAwwJbG9jYWxob3N0MFkwEwYHKoZIzj0C ` func TestConnection_Correct(t *testing.T) { - config.SetupTestConfig("./../../peer") + testutil.SetupTestConfig("./../../peer") viper.Set("ledger.blockchain.deploy-system-chaincode", "false") peerAddress := GetPeerTestingAddress("7051") var tmpConn *grpc.ClientConn @@ -69,7 +69,7 @@ func TestConnection_Correct(t *testing.T) { } func TestConnection_WrongAddress(t *testing.T) { - config.SetupTestConfig("./../../peer") + testutil.SetupTestConfig("./../../peer") viper.Set("ledger.blockchain.deploy-system-chaincode", "false") peerAddress := GetPeerTestingAddress("7052") var tmpConn *grpc.ClientConn diff --git a/core/container/dockercontroller/dockercontroller_test.go b/core/container/dockercontroller/dockercontroller_test.go index 0c8b02ffdda..4772f6d3865 100644 --- a/core/container/dockercontroller/dockercontroller_test.go +++ b/core/container/dockercontroller/dockercontroller_test.go @@ -25,11 +25,11 @@ import ( "github.com/spf13/viper" "github.com/hyperledger/fabric/common/ledger/testutil" - "github.com/hyperledger/fabric/core/config" + coreutil "github.com/hyperledger/fabric/core/testutil" ) func TestHostConfig(t *testing.T) { - config.SetupTestConfig("./../../../peer") + coreutil.SetupTestConfig("./../../../peer") var hostConfig = new(docker.HostConfig) err := viper.UnmarshalKey("vm.docker.hostConfig", hostConfig) if err != nil { @@ -44,7 +44,7 @@ func TestHostConfig(t *testing.T) { func TestGetDockerHostConfig(t *testing.T) { os.Setenv("HYPERLEDGER_VM_DOCKER_HOSTCONFIG_NETWORKMODE", "overlay") os.Setenv("HYPERLEDGER_VM_DOCKER_HOSTCONFIG_CPUSHARES", fmt.Sprint(1024*1024*1024*2)) - config.SetupTestConfig("./../../../peer") + coreutil.SetupTestConfig("./../../../peer") hostConfig := getDockerHostConfig() testutil.AssertNotNil(t, hostConfig) testutil.AssertEquals(t, hostConfig.NetworkMode, "overlay") diff --git a/core/config/config.go b/core/testutil/config.go similarity index 99% rename from core/config/config.go rename to core/testutil/config.go index a453f2d1e70..c1122b35eae 100644 --- a/core/config/config.go +++ b/core/testutil/config.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package config +package testutil import ( "flag"