Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apisix/runner/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ def __init__(self, config: NewServerConfig):
self.sock.bind(self.fd)
self.sock.listen(1024)

# the default socket permission is 0755, which prevents the 'nobody' worker process
# from writing to it if the APISIX is run under root.
os.chmod(self.fd, 0o766)
if os.stat(self.fd).st_mode & 0xfff != 0o766:
raise Exception("can't change mode for unix socket permission to 766")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the CI configuration so the e2e test can pass?
We need to adjust the port of Admin API.


self.logger = NewServerLogger(config.logging.level)

print("listening on unix:%s" % self.fd)
Expand Down
40 changes: 29 additions & 11 deletions ci/apisix/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,39 @@
#

apisix:
allow_admin:
- 0.0.0.0/0
node_listen:
- 9080
enable_control: true
control:
ip: "0.0.0.0"
port: 9092
admin_key:
- name: admin
key: edd1c9f034335f136f87ad84b625c8f1
role: admin
etcd:
host:
- http://etcd:2379
prefix: "/apisix"
timeout: 30

deployment:
role: traditional
role_traditional:
config_provider: etcd
admin:
admin_key:
-
name: admin
key: edd1c9f034335f136f87ad84b625c8f1
role: admin

enable_admin_cors: true
allow_admin:
- 0.0.0.0/0
admin_listen:
ip: 0.0.0.0
port: 9180

admin_api_version: v3

etcd:
host:
- "http://etcd:2379"
timeout: 30
startup_retry: 2

ext-plugin:
path_for_test: /tmp/runner.sock
nginx_config:
Expand Down
1 change: 1 addition & 0 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
depends_on:
- etcd
ports:
- "9180:9180/tcp"
- "9080:9080/tcp"
- "9091:9091/tcp"
- "9443:9443/tcp"
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/plugins/plugins_rewrite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = ginkgo.Describe("Rewrite Plugin", func() {
tools.RunTestCase(tc)
},
table.Entry("create python runner rewrite plugin route success", tools.HttpTestCase{
Object: tools.GetA6Expect(),
Object: tools.PutA6Conf(),
Method: http.MethodPut,
Path: "/apisix/admin/routes/1",
Body: `{
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/plugins/plugins_stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var _ = ginkgo.Describe("Stop Plugin", func() {
tools.RunTestCase(tc)
},
table.Entry("create python runner stop plugin route success", tools.HttpTestCase{
Object: tools.GetA6Expect(),
Object: tools.PutA6Conf(),
Method: http.MethodPut,
Path: "/apisix/admin/routes/1",
Body: `{
Expand Down
10 changes: 8 additions & 2 deletions tests/e2e/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,22 @@ import (

var (
token = "edd1c9f034335f136f87ad84b625c8f1"
A6Host = "http://127.0.0.1:9080"
A6_CP_Host = "http://127.0.0.1:9180"
A6_DP_Host = "http://127.0.0.1:9080"
)

func GetAdminToken() string {
return token
}

func PutA6Conf() *httpexpect.Expect {
t := ginkgo.GinkgoT()
return httpexpect.New(t, A6_CP_Host)
}

func GetA6Expect() *httpexpect.Expect {
t := ginkgo.GinkgoT()
return httpexpect.New(t, A6Host)
return httpexpect.New(t, A6_DP_Host)
}

type HttpTestCase struct {
Expand Down