Skip to content

Commit

Permalink
Update smoktest from mainline
Browse files Browse the repository at this point in the history
  • Loading branch information
plorenz committed Jan 14, 2025
1 parent b9ba3b3 commit d132f4f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 18 deletions.
6 changes: 3 additions & 3 deletions zititest/models/smoke/actions/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ func (a *bootstrapAction) bind(m *model.Model) model.Action {
workflow.AddAction(component.Start(".ctrl"))

if isHA {
workflow.AddAction(semaphore.Sleep(10 * time.Second))
workflow.AddAction(edge.RaftJoin(".ctrl"))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(edge.InitRaftController("#ctrl1"))
}
Expand Down Expand Up @@ -182,7 +180,9 @@ func (a *bootstrapAction) bind(m *model.Model) model.Action {
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "client-routers", "--edge-router-roles", "#client", "--identity-roles", "#client"))
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "host-routers", "--edge-router-roles", "#host", "--identity-roles", "#host"))

workflow.AddAction(component.Stop(models.ControllerTag))
if isHA {
workflow.AddAction(edge.RaftJoin(".ctrl"))
}

return workflow
}
2 changes: 2 additions & 0 deletions zititest/models/smoke/configs/ctrl.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ raft:
dataDir: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/ctrldata
{{else}}
db: /home/{{ .Model.MustVariable "credentials.ssh.username" }}/fablab/ctrl.db
routerDataModel:
enabled: true
{{end}}

identity:
Expand Down
6 changes: 6 additions & 0 deletions zititest/models/smoke/configs/router.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ identity:
key: /home/{{$ssh_username}}/fablab/cfg/{{$identity}}.key
ca: /home/{{$ssh_username}}/fablab/cfg/{{$identity}}-server.chain.pem

tls:
handshakeTimeout: 30s

ctrl:
endpoints: {{ range $host := .Model.MustSelectHosts "component.ctrl" 1 }}
- tls:{{ $host.PublicIp }}:6262{{end}}
startupTimeout: 5m

healthChecks:
ctrlPingCheck:
Expand All @@ -41,6 +45,8 @@ link:
advertise: tls:{{$router_ip}}:6000
dialers:
- binding: transport
options:
connectTimeout: 30s

listeners:
{{if .Component.HasTag "tunneler"}}
Expand Down
41 changes: 26 additions & 15 deletions zititest/models/smoke/smoketest.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/openziti/fablab/kernel/lib/actions/component"
"github.com/openziti/fablab/kernel/lib/binding"
"github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/aws_ssh_key"
semaphore0 "github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/semaphore"
semaphore "github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/semaphore"
terraform_0 "github.com/openziti/fablab/kernel/lib/runlevel/0_infrastructure/terraform"
distribution "github.com/openziti/fablab/kernel/lib/runlevel/3_distribution"
"github.com/openziti/fablab/kernel/lib/runlevel/3_distribution/rsync"
Expand All @@ -38,7 +38,9 @@ import (
"time"
)

const ZitiEdgeTunnelVersion = "v2.0.0-alpha1"
const ZitiEdgeTunnelVersion = "v1.2.9"
const ZitiCtrlVersion = ""
const ZitiRouterVersion = ""

//go:embed configs
var configResource embed.FS
Expand Down Expand Up @@ -95,7 +97,7 @@ var Model = &model.Model{
}),
model.FactoryFunc(func(m *model.Model) error {
return m.ForEachHost("*", 1, func(host *model.Host) error {
host.InstanceType = "t2.micro"
host.InstanceType = "t3.micro"
return nil
})
}),
Expand Down Expand Up @@ -138,15 +140,19 @@ var Model = &model.Model{
Components: model.Components{
"ctrl1": {
Scope: model.Scope{Tags: model.Tags{"ctrl"}},
Type: &zitilab.ControllerType{},
Type: &zitilab.ControllerType{
Version: ZitiCtrlVersion,
},
},
},
},
"ctrl2": {
Components: model.Components{
"ctrl2": {
Scope: model.Scope{Tags: model.Tags{"ctrl", "ha"}},
Type: &zitilab.ControllerType{},
Type: &zitilab.ControllerType{
Version: ZitiCtrlVersion,
},
},
},
},
Expand All @@ -156,7 +162,8 @@ var Model = &model.Model{
"router-east-1": {
Scope: model.Scope{Tags: model.Tags{"edge-router", "terminator", "tunneler", "client"}},
Type: &zitilab.RouterType{
Debug: false,
Debug: false,
Version: ZitiRouterVersion,
},
},
"zcat": {
Expand All @@ -170,7 +177,8 @@ var Model = &model.Model{
"router-east-2": {
Scope: model.Scope{Tags: model.Tags{"edge-router", "initiator"}},
Type: &zitilab.RouterType{
Debug: false,
Debug: false,
Version: ZitiRouterVersion,
},
},
},
Expand All @@ -179,10 +187,10 @@ var Model = &model.Model{
Scope: model.Scope{Tags: model.Tags{"zet-client"}},
Components: model.Components{
"ziti-edge-tunnel-client": {
Scope: model.Scope{Tags: model.Tags{"sdk-app", "client"}},
Scope: model.Scope{Tags: model.Tags{"sdk-app", "client", "zet"}},
Type: &zitilab.ZitiEdgeTunnelType{
Version: ZitiEdgeTunnelVersion,
VerbosityLevel: 6,
VerbosityLevel: 3,
},
},
},
Expand All @@ -206,7 +214,9 @@ var Model = &model.Model{
Components: model.Components{
"ctrl3": {
Scope: model.Scope{Tags: model.Tags{"ctrl", "ha"}},
Type: &zitilab.ControllerType{},
Type: &zitilab.ControllerType{
Version: ZitiCtrlVersion,
},
},
},
},
Expand All @@ -216,7 +226,8 @@ var Model = &model.Model{
"router-west": {
Scope: model.Scope{Tags: model.Tags{"edge-router", "tunneler", "host", "ert-host"}},
Type: &zitilab.RouterType{
Debug: false,
Debug: false,
Version: ZitiRouterVersion,
},
},
"echo-server": {
Expand All @@ -240,14 +251,14 @@ var Model = &model.Model{
"ziti-edge-tunnel-host": {
Components: model.Components{
"ziti-edge-tunnel-host": {
Scope: model.Scope{Tags: model.Tags{"sdk-app", "host", "zet-host"}},
Scope: model.Scope{Tags: model.Tags{"sdk-app", "host", "zet-host", "zet"}},
Type: &zitilab.ZitiEdgeTunnelType{
Version: ZitiEdgeTunnelVersion,
VerbosityLevel: 6,
VerbosityLevel: 3,
},
},
"iperf-server-zet": {
Scope: model.Scope{Tags: model.Tags{"iperf", "service", "zet"}},
Scope: model.Scope{Tags: model.Tags{"iperf", "service"}},
Type: &zitilab.IPerfServerType{},
},
"caddy-zet": {
Expand Down Expand Up @@ -310,7 +321,7 @@ var Model = &model.Model{
aws_ssh_key.Express(),
&terraform_0.Terraform{
Retries: 3,
ReadyCheck: &semaphore0.ReadyStage{
ReadyCheck: &semaphore.ReadyStage{
MaxWait: 90 * time.Second,
},
},
Expand Down

0 comments on commit d132f4f

Please sign in to comment.