4 Commits

Author SHA1 Message Date
99fe19be4f Added wait group 2021-09-22 17:48:30 +02:00
Senad Uka
7e3650352e Removed tls 2021-09-22 16:33:01 +02:00
Senad Uka
58f003ec99 Fix naming and typos 2021-09-20 13:32:36 +02:00
Senad Uka
c6102ec199 Merge branch 'initial-commit' into 'main'
Initial commit

See merge request ukacorp/xmpploadtesting!1
2021-09-20 10:53:20 +00:00
8 changed files with 228 additions and 26 deletions

View File

@@ -5,18 +5,13 @@ A tool for testing xmpp servers load
| Variable | Required | Default Value | Description |
| ------------------------------------------------- | -------- | --------------------------------- | ---------------------------------------------- |
| **Service:** |
| OPENFIRE_PORT | NO | 5222 | Port for openfire server |
| OPENFIRE_ADRESS | YES | | Openfire server address |
| OPENFIRE_DOMAIN | YES | | Domain |
| |
| **Credentials:** |
| |
| CREDENTIALS_FILE_LOCATION | NO | input.json | Database username |
| |
| **GeneralOptions:** |
| |
| MASSAGE_DELAY | NO | 120000000000 - 2 mins | Delay for online presence message loop |
| STATUS_MASSAGE_DELAY | NO | 10 sec | Delay for online presence message loop |
| PRESENCE_STATUS_DELAY | NO | 120000000000 - 2 mins | Delay for online presence message loop |
| COMMAND_REPLY_DELAY | NO | 10 sec | Delay for online presence message loop |
| |

View File

@@ -9,16 +9,14 @@ func Load() {
AppConfig = Config{
Service: Service{
Port: getEnv("OPENFIRE_PORT", "5222"),
Address: mustGetEnv("OPENFIRE_ADRESS"),
Domain: mustGetEnv("OPENFIRE_DOMAIN"),
Port: getEnv("OPENFIRE_PORT", "5222"),
},
Credentials: Credentials{
CredentialsFileLocation: getEnv("CREDENTIALS_FILE_LOCATION", "input.json"),
},
GeneralOptions: GeneralOptions{
DelayBetweenMassages: int64(getEnvInt("MASSAGE_DELAY", 120000000000)),
StatusMessageDelay: getEnvInt("STATUS_MASSAGE_DELAY", 10),
PresenceStatusDelay: int64(getEnvInt("PRESENCE_STATUS_DELAY", 2) * 60),
CommandReplyDelay: getEnvInt("COMMAND_REPLY_DELAY", 10),
},
}
}

View File

@@ -21,6 +21,6 @@ type Credentials struct {
// GeneralOptions contains information for general configuration options
type GeneralOptions struct {
DelayBetweenMassages int64
StatusMessageDelay int
PresenceStatusDelay int64
CommandReplyDelay int
}

3
go.mod
View File

@@ -2,9 +2,10 @@ module github.com/xmpploadtesting
go 1.17
require gosrc.io/xmpp v0.5.1
require (
github.com/google/uuid v1.1.1 // indirect
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 // indirect
gosrc.io/xmpp v0.5.1 // indirect
nhooyr.io/websocket v1.6.5 // indirect
)

View File

@@ -36,7 +36,7 @@ func main() {
}
// Delay before sending another message
time.Sleep(time.Duration(appConfig.AppConfig.GeneralOptions.DelayBetweenMassages))
time.Sleep(time.Duration(appConfig.AppConfig.GeneralOptions.PresenceStatusDelay))
}

202
over9000.json Normal file
View File

@@ -0,0 +1,202 @@
[
{"username": "DEVICE1", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7905efdb805e"},
{"username": "DEVICE2", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "716eb3a58957"},
{"username": "DEVICE3", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7cdfc56e9910"},
{"username": "DEVICE4", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "2a5170a39bd8"},
{"username": "DEVICE5", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "927c8c380d8b"},
{"username": "DEVICE6", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8ad93c625414"},
{"username": "DEVICE7", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e1f0eb824d74"},
{"username": "DEVICE8", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "cdb72f142f82"},
{"username": "DEVICE9", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "520b958a2133"},
{"username": "DEVICE10", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5b362edb2ed4"},
{"username": "DEVICE11", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "85b9eace1d22"},
{"username": "DEVICE12", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5e2f8e01ea3d"},
{"username": "DEVICE13", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "1b08b61cb4ed"},
{"username": "DEVICE14", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c4178cf4cbed"},
{"username": "DEVICE15", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "2fbfbec71f98"},
{"username": "DEVICE16", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "21288b5d9f7a"},
{"username": "DEVICE17", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "cbf0dceed251"},
{"username": "DEVICE18", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8556c3d6bcea"},
{"username": "DEVICE19", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "402d9eb9ca99"},
{"username": "DEVICE20", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b952297f0948"},
{"username": "DEVICE21", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5382ef122155"},
{"username": "DEVICE22", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b6010769064f"},
{"username": "DEVICE23", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c764861f2044"},
{"username": "DEVICE24", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ddbc95a1292c"},
{"username": "DEVICE25", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b19224fa2daa"},
{"username": "DEVICE26", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0b52b83a1ece"},
{"username": "DEVICE27", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d6efb959650a"},
{"username": "DEVICE28", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7750a46a2437"},
{"username": "DEVICE29", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "384583371916"},
{"username": "DEVICE30", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "18aceda2113b"},
{"username": "DEVICE31", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "1fed62f247ca"},
{"username": "DEVICE32", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "02034ed69a3d"},
{"username": "DEVICE33", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "1582c9874811"},
{"username": "DEVICE34", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "94766c6a7726"},
{"username": "DEVICE35", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b478bcc1c61d"},
{"username": "DEVICE36", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "851e7d547732"},
{"username": "DEVICE37", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fb39e94cfd8b"},
{"username": "DEVICE38", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "cfe92f2b545b"},
{"username": "DEVICE39", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "719d7c0060cb"},
{"username": "DEVICE40", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c48be94af4cc"},
{"username": "DEVICE41", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fd8ac8487dac"},
{"username": "DEVICE42", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0447a6eacef1"},
{"username": "DEVICE43", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "065f2af793f9"},
{"username": "DEVICE44", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "308dfc28b2c5"},
{"username": "DEVICE45", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "269574f50066"},
{"username": "DEVICE46", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "21cdf7098a19"},
{"username": "DEVICE47", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "79388b21fadd"},
{"username": "DEVICE48", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "666dfb4abc73"},
{"username": "DEVICE49", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8665b5ed8205"},
{"username": "DEVICE50", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3f4e520ac5dd"},
{"username": "DEVICE51", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "4d8eb88e3896"},
{"username": "DEVICE52", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "42255979f368"},
{"username": "DEVICE53", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "adf6098ae179"},
{"username": "DEVICE54", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "152207e865a6"},
{"username": "DEVICE55", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "27d2065f2f3d"},
{"username": "DEVICE56", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c06a0a5c93fb"},
{"username": "DEVICE57", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c3c447a82383"},
{"username": "DEVICE58", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3f19a6bc3b4f"},
{"username": "DEVICE59", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e02f32821ea6"},
{"username": "DEVICE60", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "078f0aa4e17b"},
{"username": "DEVICE61", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5430cd6fbf4e"},
{"username": "DEVICE62", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8934d927a5bd"},
{"username": "DEVICE63", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3c38caf6d03d"},
{"username": "DEVICE64", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "aa351c58adc8"},
{"username": "DEVICE65", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6bf412cedcc4"},
{"username": "DEVICE66", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6abce540b471"},
{"username": "DEVICE67", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d6bf79a42bbe"},
{"username": "DEVICE68", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3cc6f936baf6"},
{"username": "DEVICE69", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "2cb325f70c23"},
{"username": "DEVICE70", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "66f7f8694095"},
{"username": "DEVICE71", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "58901e1416de"},
{"username": "DEVICE72", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "586c1f2e892b"},
{"username": "DEVICE73", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "901e5e78f4f3"},
{"username": "DEVICE74", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "874aad37b21f"},
{"username": "DEVICE75", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "4dbcb6c593d7"},
{"username": "DEVICE76", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6739f40b14f2"},
{"username": "DEVICE77", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "aac2f72f554b"},
{"username": "DEVICE78", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e085b16095a4"},
{"username": "DEVICE79", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a01d525e23e7"},
{"username": "DEVICE80", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fd81c379eb3b"},
{"username": "DEVICE81", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0d7a0ba32cec"},
{"username": "DEVICE82", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fc76a94ef7e6"},
{"username": "DEVICE83", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8fa4c6b7300f"},
{"username": "DEVICE84", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d81db5e1bc6b"},
{"username": "DEVICE85", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f69e6e563276"},
{"username": "DEVICE86", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b444321cb6a6"},
{"username": "DEVICE87", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "904339b43525"},
{"username": "DEVICE88", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a1633067ae90"},
{"username": "DEVICE89", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "25a90368d901"},
{"username": "DEVICE90", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "8d0bf5906412"},
{"username": "DEVICE91", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ae65df71ed25"},
{"username": "DEVICE92", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "85637453a310"},
{"username": "DEVICE93", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b0a96a6d3954"},
{"username": "DEVICE94", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fc58fbf2f917"},
{"username": "DEVICE95", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e189361df065"},
{"username": "DEVICE96", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6c5624226d92"},
{"username": "DEVICE97", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "4d3c9eb1404c"},
{"username": "DEVICE98", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "bc9d0a5e0085"},
{"username": "DEVICE99", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "97c25b47f2e8"},
{"username": "DEVICE100", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "470d9f53bba2"},
{"username": "DEVICE101", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7cee917756fd"},
{"username": "DEVICE102", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9f6cadd6f88c"},
{"username": "DEVICE103", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e609231d2354"},
{"username": "DEVICE104", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "1f632e849e9a"},
{"username": "DEVICE105", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "bc12accc802f"},
{"username": "DEVICE106", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9106f01ad123"},
{"username": "DEVICE107", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "c1a2143e4819"},
{"username": "DEVICE108", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "16398f9f7d4a"},
{"username": "DEVICE109", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0f35e5bd8bcf"},
{"username": "DEVICE110", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6c1e35f3abb2"},
{"username": "DEVICE111", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "49b73c2e5aec"},
{"username": "DEVICE112", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "179ac1ec8195"},
{"username": "DEVICE113", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9923af6408b1"},
{"username": "DEVICE114", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5dee926d2f1b"},
{"username": "DEVICE115", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a9e8fe3d81df"},
{"username": "DEVICE116", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b29e1b00c904"},
{"username": "DEVICE117", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "224bf53e4668"},
{"username": "DEVICE118", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5f2c48f50526"},
{"username": "DEVICE119", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "28c57c848956"},
{"username": "DEVICE120", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f98e6803be78"},
{"username": "DEVICE121", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b3186b7cbd08"},
{"username": "DEVICE122", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0abc8c50bbb3"},
{"username": "DEVICE123", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "441707363719"},
{"username": "DEVICE124", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b38dacaa3471"},
{"username": "DEVICE125", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0d2d47294939"},
{"username": "DEVICE126", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d2df06196df8"},
{"username": "DEVICE127", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "196c935af938"},
{"username": "DEVICE128", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e76e15c03f8a"},
{"username": "DEVICE129", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a482ffed3c22"},
{"username": "DEVICE130", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d183d5d0af94"},
{"username": "DEVICE131", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5481e33e6a11"},
{"username": "DEVICE132", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "fa40f3361a90"},
{"username": "DEVICE133", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "4498d287b6e2"},
{"username": "DEVICE134", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f2f02e086bf1"},
{"username": "DEVICE135", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "35e828ae8c97"},
{"username": "DEVICE136", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "01247ff293f3"},
{"username": "DEVICE137", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6134711642bf"},
{"username": "DEVICE138", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7b8f33081112"},
{"username": "DEVICE139", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "68dc51b2f78b"},
{"username": "DEVICE140", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ac0c8c631ce8"},
{"username": "DEVICE141", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6dad160705db"},
{"username": "DEVICE142", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "be080b717160"},
{"username": "DEVICE143", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "955c5b253fdc"},
{"username": "DEVICE144", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5b1d07269840"},
{"username": "DEVICE145", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9dcd71a227de"},
{"username": "DEVICE146", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b8bf4d570b3b"},
{"username": "DEVICE147", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f72218eb337b"},
{"username": "DEVICE148", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "4e77f4b854bc"},
{"username": "DEVICE149", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "e1505fe70e51"},
{"username": "DEVICE150", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "d61997b7130a"},
{"username": "DEVICE151", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "09e939aa02ce"},
{"username": "DEVICE152", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b7ed742d7d02"},
{"username": "DEVICE153", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "286b44285eea"},
{"username": "DEVICE154", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "76b4461ed767"},
{"username": "DEVICE155", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9fce033d93bf"},
{"username": "DEVICE156", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "607f392c26a8"},
{"username": "DEVICE157", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "80e58a645c69"},
{"username": "DEVICE158", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "ccc61377ff2b"},
{"username": "DEVICE159", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f7192fef6789"},
{"username": "DEVICE160", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "830fc427409e"},
{"username": "DEVICE161", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b15be14b6423"},
{"username": "DEVICE162", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9f44ccd4b415"},
{"username": "DEVICE163", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b13ab64261e1"},
{"username": "DEVICE164", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "daf1d9807ba7"},
{"username": "DEVICE165", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "74a5c420154a"},
{"username": "DEVICE166", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "b751ce4f3051"},
{"username": "DEVICE167", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f7b20f3ec577"},
{"username": "DEVICE168", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "81414f2b1952"},
{"username": "DEVICE169", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f1d949c2d093"},
{"username": "DEVICE170", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "628e9986478a"},
{"username": "DEVICE171", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "358b02a5b485"},
{"username": "DEVICE172", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "64fe3b6acb21"},
{"username": "DEVICE173", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "242a5e9564a2"},
{"username": "DEVICE174", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "a703b9ec7863"},
{"username": "DEVICE175", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0d286a8c55a7"},
{"username": "DEVICE176", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3da227b0ca1c"},
{"username": "DEVICE177", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "21bad7705f5c"},
{"username": "DEVICE178", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "9eddbe2fb042"},
{"username": "DEVICE179", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "abc131958a7b"},
{"username": "DEVICE180", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7c6fe6ae2641"},
{"username": "DEVICE181", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "26484015c269"},
{"username": "DEVICE182", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "cc6cee1c162d"},
{"username": "DEVICE183", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "7fa0b60c9a00"},
{"username": "DEVICE184", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "f6823c2c7740"},
{"username": "DEVICE185", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "024815369af8"},
{"username": "DEVICE186", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "2f548c69a99c"},
{"username": "DEVICE187", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "5197f42ed201"},
{"username": "DEVICE188", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "987c8a4c9565"},
{"username": "DEVICE189", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "1156677279df"},
{"username": "DEVICE190", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "14f508646b46"},
{"username": "DEVICE191", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "dd9798b5aa10"},
{"username": "DEVICE192", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "3e4af4f238ba"},
{"username": "DEVICE193", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "0dd66ec41c16"},
{"username": "DEVICE194", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "07adfec0affc"},
{"username": "DEVICE195", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "22943aeb8f41"},
{"username": "DEVICE196", "host": "rolling-stock-sandbox2-openfire.onsmartengineering.com", "port": 5222, "ping": 15, "password": "6e74f9b7a215"},
{"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"}
]

View File

@@ -1,7 +1,6 @@
package services
import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
@@ -9,11 +8,13 @@ import (
"math/rand"
"os"
"strconv"
"sync"
"time"
appConfig "github.com/xmpploadtesting/config"
"gosrc.io/xmpp"
"gosrc.io/xmpp/stanza"
"mellium.im/xmpp"
)
const rolingStockPresenceMessage = `ROLLING STOCK PRESENCE MESSAGE
@@ -91,8 +92,10 @@ func Init() {
log.Printf("Client credentials length %v", len(clientCredentials))
xmppService.XMPPClients = make([]XMPPClient, 0)
var wg sync.WaitGroup
for _, credential := range clientCredentials {
wg.Add(1)
log.Printf("Host %v", credential.Host+":"+strconv.Itoa(credential.Port))
log.Printf("Jid %v", credential.Jid+"@"+credential.Host)
log.Printf("Port %v", credential.Port)
@@ -102,9 +105,9 @@ func Init() {
Config: xmpp.Config{
TransportConfiguration: xmpp.TransportConfiguration{
Address: credential.Host + ":" + strconv.Itoa(credential.Port),
Domain: credential.Host,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
Address: credential.Host + ":" + strconv.Itoa(credential.Port),
Domain: credential.Host,
// TLSConfig: &tls.Config{InsecureSkipVerify: false},
},
Jid: credential.Jid + "@" + credential.Host,
Credential: xmpp.Password(credential.Credential),
@@ -114,6 +117,7 @@ func Init() {
}
go func() {
defer wg.Done()
client, err := xmpp.NewClient(&xmppClient.Config, xmppService.Router, errorHandler)
@@ -133,8 +137,10 @@ func Init() {
}()
}
// Delay For two seccond to allow all clients to connect
time.Sleep(time.Duration(2000000000))
// // Delay For two seccond to allow all clients to connect
// time.Sleep(time.Duration(2000000000))
// Wait untill all client connections are open sucessfuly
wg.Wait()
}
@@ -194,10 +200,10 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
}
log.Printf("<%v> received following message: %v", msg.To, msg.Body)
statusMesageDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.StatusMessageDelay))
log.Printf("DELAYING FOR: %v", statusMesageDelay*1000000000)
// Delay For two seccond to allow all clients to connect
time.Sleep(time.Duration(statusMesageDelay * 1000000000))
commandReplyDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
log.Printf("Waiting FOR: %v", commandReplyDelay*1000000000)
// Delay For two second to allow all clients to connect
time.Sleep(time.Duration(commandReplyDelay * 1000000000))
reply := stanza.Message{Attrs: stanza.Attrs{To: msg.From}, Body: `{"status": "OK"}`}
err := s.Send(reply)

BIN
xmpploadtesting Executable file

Binary file not shown.