-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-1571136 Add
network tcp-check
command (#472)
* SNOW-1571136 Add `network tcp-check` command * SNOW-1571136 Add set up dev env to readme * SNOW-1571136 Add golangci to pre-commit
- Loading branch information
1 parent
85e40d2
commit 4d1444b
Showing
38 changed files
with
2,992 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
go-version-file: 'go.mod' | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] | ||
test: | ||
unit_test: | ||
name: Unit tests | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
|
@@ -34,6 +34,20 @@ jobs: | |
sudo apt-get install ansible | ||
sudo apt-get install gdb | ||
sudo apt-get install python3 | ||
- name: integration tests | ||
- name: integration bash tests | ||
run: ./testing/integrate.sh | ||
shell: bash | ||
- name: integration tests | ||
run: go test -tags=integration ./... | ||
shell: bash | ||
integration_test: | ||
name: Unit tests | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: integration tests | ||
run: INTEGRATION_TEST=yes go test -run "^TestIntegration.*$" ./... | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Services architecture | ||
SansShell is built on a principle of "Don't pay for what you don't use". This | ||
is advantageous in both minimizing the resources of SansShell server (binary | ||
size, memory footprint, etc) as well as reducing the security risk of running | ||
it. To accomplish that, all of the SansShell services are independent modules, | ||
which can be optionally included at build time. | ||
|
||
It is divided into 2 parts: | ||
- `client`, part of cli app running on local | ||
- `server`, part of server app running on remote machine | ||
|
||
Each part follows hexagonal architecture. It divides into following layers: | ||
- `application`, contains the application logic | ||
- `infrastructure`, contains the implementation of the ports and adapters | ||
- `input`, contains user interface/api adapters implementation, such as GRPC controllers, CLI command handlers and etc | ||
- `output`, contains adapters to external systems implementation, such as HTTP/GRPC client, repositories and etc | ||
|
||
Other: | ||
- `./<service-name>.go` contains the service related commands | ||
- `./<service-name>.proto` protobuf definition of client-server communication | ||
- `./<service-name>.pb.go` GoLang definition of `./<service-name>.proto` file. **Auto-generated**. Do not edit manually | ||
- `./<service-name>_grpc.pb.go` Pure definition of GRPC client and server. **Auto-generated**. Do not edit manually | ||
- `./<service-name>_grpcproxy.pb.go` Sansshell extension of pure GRPC client and server, go [here](../proxy/README.md) to know more. **Auto-generated**. Do not edit manually |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Network | ||
This directory contains the network services. This defines network related commands like `ping`, `traceroute`, `netstat`, etc. | ||
|
||
What is not part of network service? Commands related to protocols build on top of network layer like `http`, `ftp`, `ssh`, etc. | ||
|
||
## Usage | ||
|
||
### sanssh network tcp-check | ||
Check if a TCP port is open on a remote host. | ||
|
||
```bash | ||
sanssh <sanssh-args> network tcp-check <host>:<port> [--timeout <timeout>] | ||
``` | ||
Where: | ||
- `<sanssh-args>` common sanssh arguments | ||
- `<host>` is the host to check | ||
- `<port>` is the port to check | ||
- `<timeout>` timeout in seconds to wait for the connection to be established. Default is 3 seconds. | ||
|
||
# Useful docs | ||
- [service-architecture](../../docs/services-architecture.md) |
Oops, something went wrong.