mirror of
https://github.com/status-im/consul.git
synced 2025-01-24 20:51:10 +00:00
Add namespace file with build tag for OSS gateway tests (#16590)
* Add namespace file with build tag for OSS tests * Remove TODO comment
This commit is contained in:
parent
e6aeb31a26
commit
fa93a0d4f7
@ -83,10 +83,11 @@ func TestAPIGatewayCreate(t *testing.T) {
|
|||||||
// Create a client proxy instance with the server as an upstream
|
// Create a client proxy instance with the server as an upstream
|
||||||
_, gatewayService := createServices(t, cluster, listenerPortOne)
|
_, gatewayService := createServices(t, cluster, listenerPortOne)
|
||||||
|
|
||||||
//make sure the gateway/route come online
|
// make sure the gateway/route come online
|
||||||
//make sure config entries have been properly created
|
// make sure config entries have been properly created
|
||||||
checkGatewayConfigEntry(t, client, "api-gateway", "")
|
namespace := getNamespace()
|
||||||
checkTCPRouteConfigEntry(t, client, "api-gateway-route", "")
|
checkGatewayConfigEntry(t, client, "api-gateway", namespace)
|
||||||
|
checkTCPRouteConfigEntry(t, client, "api-gateway-route", namespace)
|
||||||
|
|
||||||
port, err := gatewayService.GetPort(listenerPortOne)
|
port, err := gatewayService.GetPort(listenerPortOne)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
@ -5,21 +5,19 @@ import (
|
|||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/api"
|
"github.com/hashicorp/consul/api"
|
||||||
libassert "github.com/hashicorp/consul/test/integration/consul-container/libs/assert"
|
libassert "github.com/hashicorp/consul/test/integration/consul-container/libs/assert"
|
||||||
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
libcluster "github.com/hashicorp/consul/test/integration/consul-container/libs/cluster"
|
||||||
libservice "github.com/hashicorp/consul/test/integration/consul-container/libs/service"
|
libservice "github.com/hashicorp/consul/test/integration/consul-container/libs/service"
|
||||||
libtopology "github.com/hashicorp/consul/test/integration/consul-container/libs/topology"
|
libtopology "github.com/hashicorp/consul/test/integration/consul-container/libs/topology"
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func getNamespace() string {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// randomName generates a random name of n length with the provided
|
// randomName generates a random name of n length with the provided
|
||||||
// prefix. If prefix is omitted, the then entire name is random char.
|
// prefix. If prefix is omitted, the then entire name is random char.
|
||||||
func randomName(prefix string, n int) string {
|
func randomName(prefix string, n int) string {
|
||||||
@ -80,7 +78,6 @@ func TestHTTPRouteFlattening(t *testing.T) {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
//TODO this should only matter in consul enterprise I believe?
|
|
||||||
namespace := getNamespace()
|
namespace := getNamespace()
|
||||||
gatewayName := randomName("gw", 16)
|
gatewayName := randomName("gw", 16)
|
||||||
routeOneName := randomName("route", 16)
|
routeOneName := randomName("route", 16)
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
//go:build !consulent
|
||||||
|
// +build !consulent
|
||||||
|
|
||||||
|
package gateways
|
||||||
|
|
||||||
|
func getNamespace() string {
|
||||||
|
return ""
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user