1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

feat(support): collect system info bundle to assist support troubleshooting [r8s-157] (#154)

This commit is contained in:
Malcolm Lockyer 2024-12-06 15:38:10 +13:00 committed by GitHub
parent 17648d12fe
commit 783ab253af
17 changed files with 1367 additions and 440 deletions

View file

@ -7,6 +7,50 @@ import (
"github.com/stretchr/testify/assert"
)
func TestIsRegularAgentEndpoint(t *testing.T) {
tests := []struct {
name string
endpoint *portainer.Endpoint
expected bool
}{
{
name: "AgentOnDockerEnvironment",
endpoint: &portainer.Endpoint{
Type: portainer.AgentOnDockerEnvironment,
},
expected: true,
},
{
name: "AgentOnKubernetesEnvironment",
endpoint: &portainer.Endpoint{
Type: portainer.AgentOnKubernetesEnvironment,
},
expected: true,
},
{
name: "EdgeAgentOnDockerEnvironment",
endpoint: &portainer.Endpoint{
Type: portainer.EdgeAgentOnDockerEnvironment,
},
expected: false,
},
{
name: "EdgeAgentOnKubernetesEnvironment",
endpoint: &portainer.Endpoint{
Type: portainer.EdgeAgentOnKubernetesEnvironment,
},
expected: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := IsRegularAgentEndpoint(tt.endpoint)
assert.Equal(t, tt.expected, result)
})
}
}
func TestIsEdgeEndpoint(t *testing.T) {
tests := []struct {
name string