Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.1 KiB
Go
45 lines
1.1 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package commands
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost/server/v8/cmd/mmctl/client"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func (s *MmctlE2ETestSuite) TestlogsCmdF() {
|
|
s.SetupTestHelper().InitBasic()
|
|
|
|
s.RunForSystemAdminAndLocal("Display single log line", func(c client.Client) {
|
|
cmd := &cobra.Command{}
|
|
cmd.Flags().Int("number", 1, "")
|
|
|
|
data, err := testLogsCmdF(c, cmd, []string{})
|
|
s.Require().Nil(err)
|
|
s.Require().Len(data, 2)
|
|
})
|
|
|
|
s.RunForSystemAdminAndLocal("Display in logrus for formatting", func(c client.Client) {
|
|
cmd := &cobra.Command{}
|
|
cmd.Flags().Bool("logrus", true, "")
|
|
cmd.Flags().Int("number", 1, "")
|
|
|
|
data, err := testLogsCmdF(c, cmd, []string{})
|
|
s.Require().Nil(err)
|
|
s.Require().Len(data, 2)
|
|
s.Contains(data[1], "time=")
|
|
s.Contains(data[1], "level=")
|
|
s.Contains(data[1], "msg=")
|
|
})
|
|
|
|
s.Run("Should not allow normal user to retrieve logs", func() {
|
|
cmd := &cobra.Command{}
|
|
cmd.Flags().Int("number", 1, "")
|
|
|
|
_, err := testLogsCmdF(s.th.Client, cmd, []string{})
|
|
s.Require().Error(err)
|
|
})
|
|
}
|