Skip to content

Commit

Permalink
add socket name test
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthyparty committed Jun 26, 2024
1 parent ec5ba01 commit af649df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/mode/static/nginx/config/sockets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ import (
. "github.com/onsi/gomega"
)

func TestGetSocketName(t *testing.T) {
func TestGetSocketNameTLS(t *testing.T) {
res := getSocketNameTLS(800, "*.cafe.example.com")

g := NewGomegaWithT(t)
g.Expect(res).To(Equal("unix:/var/run/nginx/*.cafe.example.com800.sock"))
}

func TestGetSocketNameHTTPS(t *testing.T) {
res := getSocketNameHTTPS(800)

g := NewGomegaWithT(t)
g.Expect(res).To(Equal("unix:/var/run/nginx/https800.sock"))
}

0 comments on commit af649df

Please sign in to comment.