Skip to content

Commit

Permalink
Merge pull request #818 from threefoldtech/fix-gateway_fqdn-nightly-test
Browse files Browse the repository at this point in the history
Fix gateway fqdn integration tests
  • Loading branch information
Eslam-Nawara authored Dec 25, 2023
2 parents 10c8603 + ad64911 commit b19ae95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
12 changes: 2 additions & 10 deletions examples/resources/gateway_fqdn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,10 @@ terraform {
provider "grid" {
}

resource "grid_scheduler" "sched" {
requests {
name = "gateway"
public_config = true
public_ips_count = 1
}
}

resource "grid_fqdn_proxy" "p1" {
node = grid_scheduler.sched.nodes["gateway"]
node = 11
name = "workloadname"
fqdn = "remote.omar.grid.tf"
fqdn = "hamada1.3x0.me"
backends = [format("http://137.184.106.152:443")]
}

Expand Down
14 changes: 11 additions & 3 deletions integrationtests/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"net/http"
"os"
"testing"
"time"

Expand Down Expand Up @@ -67,7 +68,6 @@ func TestGateWay(t *testing.T) {
assert.NoError(t, err)
assert.Contains(t, string(body), "Directory listing for")
}

})

t.Run("gateway_fqdn", func(t *testing.T) {
Expand All @@ -83,7 +83,13 @@ func TestGateWay(t *testing.T) {
- Destroy the deployment
*/

fqdn := "hamada1.3x0.me" // points to node 15 devnet
// make sure the test runs only on devnet
if network, _ := os.LookupEnv("NETWORK"); network != "dev" {
t.Skip()
return
}

fqdn := "hamada1.3x0.me" // points to node 11 devnet

terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "./gateway_with_fqdn",
Expand All @@ -95,7 +101,9 @@ func TestGateWay(t *testing.T) {
defer terraform.Destroy(t, terraformOptions)

_, err := terraform.InitAndApplyE(t, terraformOptions)
assert.NoError(t, err)
if !assert.NoError(t, err) {
return
}

// Check that the outputs not empty
fqdn = terraform.Output(t, terraformOptions, "fqdn")
Expand Down
6 changes: 1 addition & 5 deletions integrationtests/gateway_with_fqdn/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ resource "grid_scheduler" "sched" {
sru = 512
mru = 1024
}
requests {
name = "gateway"
public_config = true
}
}

locals {
Expand Down Expand Up @@ -65,7 +61,7 @@ locals {
}

resource "grid_fqdn_proxy" "p1" {
node = grid_scheduler.sched.nodes["gateway"]
node = 11
name = "test"
fqdn = var.fqdn
backends = [format("http://[%s]:9000", local.ygg_ip)]
Expand Down

0 comments on commit b19ae95

Please sign in to comment.