File: README.md

package info (click to toggle)
receptor 1.5.5-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,772 kB
  • sloc: python: 1,643; makefile: 305; sh: 174
file content (113 lines) | stat: -rw-r--r-- 2,451 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Receptor tests

All test files and test tools can be found on this directory.

```java
.
|-- artifacts     : "receptor-tester.sh builds output"
|-- environments  : "Controlled environments for testing"
|   |-- container : "Containerfile recipe"
|   `-- vagrant   : "VM recipe"
`-- functional    : "Functional test files"
    |-- cli
    |-- lib
    `-- mesh
```

## Tests

1. Functional tests and correspondent docs can be found here: [./functional/README.md](./functional/README.md)

## Tools

There are two parts of Receptor tools. Each one is used for different scenarios.

Requirements:
- podman
- make

### receptor-tester

All features will be showed on `help` argument:

```bash
./receptor-tester.sh help

# Command list:
#   list-dirs    - list all available tests directories
#   list-files   - list all available tests files
#   run          - run a specific test
#   run-all      - run all tests. Returns 0 if pass
#   help         - Displays this help text
```

List all available tests:

```bash
# list all available tests directories
./receptor-tester.sh list-dirs
# ./functional/mesh
# ./functional/cli
# ./functional/lib/utils

# List all available tests files
./receptor-tester.sh list-files
# ./functional/mesh/mesh_test.go
# ./functional/mesh/work_test.go
# ./functional/mesh/tls_test.go
# ./functional/cli/cli_test.go
# ./functional/lib/utils/utils_test.go
```

Run tests:

```bash
# run a specific test
./receptor-tester.sh run ./functional/cli/cli_test.go
# run all tests
./receptor-tester.sh run-all
```

### Makefile

Build artifacts (receptor and receptorctl) based on latest source code.
The container recipe used can be found at `environments/container`.

```bash
# Build artifacts
make artifacts
```

Container commands can be used in conjunction with `make artifacts` or isolated to run ad-hoc commands inside a controlled environment.

```bash
# Rebuild container image used
# by `make artifacts`
make container-image # OR
make container-image-base

# Jump into a container created from
# the same container image used by
# `make artifacts`
make container-shell-base
```

If you're using Windows or macOS, the following commands can be useful to create a virtual machine and play aroung with containers inside there.

Requirements:
- vagrant

```bash
# Creates a Vagrant VM
make vm # OR
make vm-create

# SSH into VM
make vm-shell

# Destroy VM
make vm-destroy

# Reapply Ansible playbook into VM
make vm-provision
```