Upstream sync
This commit is contained in:
43
README.md
43
README.md
@@ -1,18 +1,47 @@
|
|||||||
# xmpploadtesting
|
# rolling-stock-display-simulation-tool
|
||||||
A tool for testing xmpp servers load
|
|
||||||
|
A tool for connecting virtual devices to the Rolling Stock platform.
|
||||||
|
Devices need to be registered and credentials prepared in a JSON file
|
||||||
|
put in input.json (or specified in a variablle)
|
||||||
|
|
||||||
|
Sample input.json file structure:
|
||||||
|
|
||||||
|
```
|
||||||
|
[
|
||||||
|
{"username": "DEVICE197", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a32c695ccde9"},
|
||||||
|
{"username": "DEVICE198", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c93f60d35d51"},
|
||||||
|
{"username": "DEVICE199", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ddf4d41f846f"},
|
||||||
|
{"username": "DEVICE200", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "07fd03b6fce0"}
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
The tool sends regular presence messages (with harcoded dummy versions content)
|
||||||
|
and properly responds with "unsupported command" to any command sent to it.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage:
|
||||||
|
|
||||||
|
```./rolling-stock-display-simulation-tool```
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
If the target system is linux amd-64 based you can just copy the binary and use it.
|
||||||
|
Otherwise build the binary like every other golang binary and then copy it.
|
||||||
|
|
||||||
|
```go build```
|
||||||
|
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
||||||
| Variable | Required | Default Value | Description |
|
| Variable | Required | Default Value | Description |
|
||||||
| ------------------------------------------------- | -------- | --------------------------------- | -----------------------------------------------------------|
|
| ------------------------------------------------- | -------- | --------------------------------- | ------------------------------------------------------------------ |
|
||||||
| **Credentials:** |
|
| **Credentials:** |
|
||||||
| |
|
| |
|
||||||
| CREDENTIALS_FILE_LOCATION | NO | input.json | Database username |
|
| CREDENTIALS_FILE_LOCATION | NO | input.json | Openfire jids and passwords |
|
||||||
| |
|
| |
|
||||||
| **GeneralOptions:** |
|
| **GeneralOptions:** |
|
||||||
| |
|
| |
|
||||||
| PRESENCE_STATUS_DELAY | NO | 2 min | Delay for online presence message loop |
|
| PRESENCE_STATUS_DELAY | NO | 120000000000 - 2 mins | Delay between two presence status message |
|
||||||
| COMMAND_REPLY_DELAY | NO | 10 sec | Delay for command message reply |
|
| COMMAND_REPLY_DELAY | NO | 10 sec | Upper limit of random time to wait before sending reply |
|
||||||
| EXECUTE_SIGLE_STATUS_MESSAGE | NO | false | Send one presence stanza message for clients and terminate|
|
|
||||||
| |
|
| |
|
||||||
|
|
||||||
|
|||||||
8
go.mod
8
go.mod
@@ -1,12 +1,14 @@
|
|||||||
module github.com/xmpploadtesting
|
module bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require gosrc.io/xmpp v0.5.1
|
require (
|
||||||
|
github.com/twinj/uuid v1.0.0
|
||||||
|
gosrc.io/xmpp v0.5.1
|
||||||
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/uuid v1.1.1 // indirect
|
github.com/google/uuid v1.1.1 // indirect
|
||||||
github.com/twinj/uuid v1.0.0 // indirect
|
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
|
||||||
nhooyr.io/websocket v1.6.5 // indirect
|
nhooyr.io/websocket v1.6.5 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
5
main.go
5
main.go
@@ -1,11 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
appConfig "bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool/config"
|
||||||
|
xmppService "bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool/services"
|
||||||
"log"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
appConfig "github.com/xmpploadtesting/config"
|
|
||||||
xmppService "github.com/xmpploadtesting/services"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Binary file not shown.
@@ -12,8 +12,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
appConfig "bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool/config"
|
||||||
"github.com/twinj/uuid"
|
"github.com/twinj/uuid"
|
||||||
appConfig "github.com/xmpploadtesting/config"
|
|
||||||
"gosrc.io/xmpp"
|
"gosrc.io/xmpp"
|
||||||
"gosrc.io/xmpp/stanza"
|
"gosrc.io/xmpp/stanza"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user