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:
parent
17648d12fe
commit
783ab253af
17 changed files with 1367 additions and 440 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue