talos/internal/integration/cli/netstat.go
Nico Berlee 97048f7c37
feat: netstat in API and client
Implements netstat in Talos API and client (talosctl).

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2023-03-09 15:48:30 +04:00

34 lines
890 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//go:build integration_cli
package cli
import (
"regexp"
"github.com/siderolabs/talos/internal/integration/base"
)
// NetstatSuite verifies etcd command.
type NetstatSuite struct {
base.CLISuite
}
// SuiteName ...
func (suite *NetstatSuite) SuiteName() string {
return "cli.NetstatSuite"
}
// TestListening verifies that there are listening connections.
func (suite *NetstatSuite) TestListening() {
suite.RunCLI([]string{"netstat", "--listening", "--programs", "--tcp", "--extend", "--nodes", suite.RandomDiscoveredNodeInternalIP()},
base.StdoutShouldMatch(regexp.MustCompile(`:::50000.+LISTEN.+/apid`)))
}
func init() {
allSuites = append(allSuites, new(NetstatSuite))
}