Skip to content

Commit

Permalink
Updated unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sroebert committed Apr 13, 2020
1 parent 0a80474 commit 1fb0b83
Show file tree
Hide file tree
Showing 16 changed files with 255 additions and 71 deletions.
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
language: generic
dist: bionic
os: linux

branches:
only:
- master
- develop

env:
global:
- CODECOV_ELIGIBLE=true

matrix:
jobs:
include:
- os: linux
dist: bionic
sudo: required
- os: linux
dist: xenial
sudo: required
- os: osx
osx_image: xcode11.4
sudo: required

before_install:
- git clone https://github.com/IBM-Swift/Package-Builder.git
Expand Down
20 changes: 20 additions & 0 deletions .travis/certs/ca.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDTjCCAjYCCQCj16WexG3HWDANBgkqhkiG9w0BAQsFADBpMQswCQYDVQQGEwJO
TDESMBAGA1UECAwJQW1zdGVyZGFtMRIwEAYDVQQHDAlBbXN0ZXJkYW0xEDAOBgNV
BAoMB3JvZWJlcnQxCzAJBgNVBAsMAkNBMRMwEQYDVQQDDApyb2ViZXJ0Lm5sMB4X
DTIwMDQxMzE1MDAxMFoXDTIxMDQxMzE1MDAxMFowaTELMAkGA1UEBhMCTkwxEjAQ
BgNVBAgMCUFtc3RlcmRhbTESMBAGA1UEBwwJQW1zdGVyZGFtMRAwDgYDVQQKDAdy
b2ViZXJ0MQswCQYDVQQLDAJDQTETMBEGA1UEAwwKcm9lYmVydC5ubDCCASIwDQYJ
KoZIhvcNAQEBBQADggEPADCCAQoCggEBAL2x1cvAnDSf31IZi/44YScsMWfSHSFQ
5efge/Wk8GYkQRVTdBQU0XIz4XV/fP1JOkTaFObhS33ExLjr9/t1HYn1LwMVw4rF
PT72ekmGkNdLC+olizWJoKUClcEPF0l703FtopAtc3KjwQ4T785fvaxXk8WTVko1
ZtFPNMpLO1LRpCYkBBfZHj3uKpOOxapbM/fDiFtu6+uXfVTWEiNwpiiJ91a+6Bw7
r8J2TUyasXwdwy7DbtnnJuOfJCFoWIlzQqxYJ/9kUw1jAVhkyW5YjbTEU6Oh7DDU
Ijxv3ltj8lTfqH1gtwFPUbL/8hjgoUPvuOXmpj/J0JE6p2UrtL3pGsECAwEAATAN
BgkqhkiG9w0BAQsFAAOCAQEAEzvOebkchTWYo7Lh+KNl2joGhRC8XXRfGSwyIgy0
fpxx0vaE2OBxlC1Rh0YZDEzUzHE4xqFijWU57a1z5CKcYnu39M13QKI79lk58oVY
LOKuif9JiG/JR63KodOuyhjsWLUiTVZFbhX5E4hn9Rek4mXDtQ04jK/Jtt/bIK/u
peYfp+STFoO1uquQfHrHKMn3vigtg/h+wRsMtDOisbt36MsHRzGYRXzgezCsezSJ
audsgzRuRY+JbiuFtMyrpzMswzd5S4m4zeaT++rXZlV1HUi4hPw/GrTEvjlY57fq
XXC1ULkrN8vFG6ZaLESE1By+SzvcEWGa3+e2lXdxQhv7pw==
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions .travis/certs/ca.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC9sdXLwJw0n99S
GYv+OGEnLDFn0h0hUOXn4Hv1pPBmJEEVU3QUFNFyM+F1f3z9STpE2hTm4Ut9xMS4
6/f7dR2J9S8DFcOKxT0+9npJhpDXSwvqJYs1iaClApXBDxdJe9NxbaKQLXNyo8EO
E+/OX72sV5PFk1ZKNWbRTzTKSztS0aQmJAQX2R497iqTjsWqWzP3w4hbbuvrl31U
1hIjcKYoifdWvugcO6/Cdk1MmrF8HcMuw27Z5ybjnyQhaFiJc0KsWCf/ZFMNYwFY
ZMluWI20xFOjoeww1CI8b95bY/JU36h9YLcBT1Gy//IY4KFD77jl5qY/ydCROqdl
K7S96RrBAgMBAAECggEBAK6jPS/y6Bwunxtnd5GY+CBnOCjbsIPOh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MVuKtLD+JCJWXNGR8QUP13Scu14GyrqnovdJQq/vgJ
QA/93hHYGMBX1iuVImcCH0TFiY9m5EyyWjY87hx7frb3Dn0ZHV8Mro8FWUNZwEEJ
pJ/K3C6K2yKTkU9w8jZpO5RDbA==
-----END PRIVATE KEY-----
1 change: 1 addition & 0 deletions .travis/certs/ca.srl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AB64B2593168AD4A
20 changes: 20 additions & 0 deletions .travis/certs/client.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDUjCCAjoCCQCrZLJZMWitSjANBgkqhkiG9w0BAQsFADBpMQswCQYDVQQGEwJO
TDESMBAGA1UECAwJQW1zdGVyZGFtMRIwEAYDVQQHDAlBbXN0ZXJkYW0xEDAOBgNV
BAoMB3JvZWJlcnQxCzAJBgNVBAsMAkNBMRMwEQYDVQQDDApyb2ViZXJ0Lm5sMB4X
DTIwMDQxMzE1MDAxMFoXDTIxMDQxMzE1MDAxMFowbTELMAkGA1UEBhMCTkwxEjAQ
BgNVBAgMCUFtc3RlcmRhbTESMBAGA1UEBwwJQW1zdGVyZGFtMRAwDgYDVQQKDAdy
b2ViZXJ0MQ8wDQYDVQQLDAZDbGllbnQxEzARBgNVBAMMCnJvZWJlcnQubmwwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCuPxzAqMsogZruai/BXiV83xJp
lYJhMb+mPPCl5kZuKmOxcXb7cBEmFhSQMr/9v5QGg5KPFzrIcgcxtzGgPU5v+jCb
2K1s8qzMSN7MPxVjaJkYPS7EiIuu7vnJbcPGNxPFoA+es5HeSV9VTE7rdUZhLw3l
vXxjJ9uxU+bW61c9ipSgO8sD7lleqqCsyOQKtlC/1+48oATlORUK36EipnGWRjpG
P//tCmlmsScIv6iuwImmg3foWp+5jCPpY/1SfeqDgd81LzF6V1SUx/P1Za/AsJyT
zSd49DcGbW+K10pWXCd+wNSkHMPHQBQvF4D41ixDC6uPGejQuEfm6upAtxD1AgMB
AAEwDQYJKoZIhvcNAQELBQADggEBAH612labVqu7HkvtcUDxfO4wE98p2xZp+MOw
nT5DpPIENTJtIak2jawbjwiDmypwNFs2qgZ/Smg08Mc9ZD3aosimXpx4Z9rDIpz2
6Kn2NM4LGdf7efzGtK6+5KvNOwK0iBhWAIFuKel+xTmQ9P6VLz6ZbU3FRZesVFBY
fhlnONzMjdX7G/2fKDmOCwjggYY1v5TEQTCWr/ITSmkQVNSazU4Ltu0wE270/P8F
iUmGOoh4v9Gymh5Estt2em1mDZ0D6kSDAXRkQgpyxD9Rc+foO2EsfDgI1eVsCws0
BGUTU6c3hgaWmGdA9TT+SPNr6QepyMP8swYFqkjLhShdZCbzZ04=
-----END CERTIFICATE-----
17 changes: 17 additions & 0 deletions .travis/certs/client.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICsjCCAZoCAQAwbTELMAkGA1UEBhMCTkwxEjAQBgNVBAgMCUFtc3RlcmRhbTES
MBAGA1UEBwwJQW1zdGVyZGFtMRAwDgYDVQQKDAdyb2ViZXJ0MQ8wDQYDVQQLDAZD
bGllbnQxEzARBgNVBAMMCnJvZWJlcnQubmwwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCuPxzAqMsogZruai/BXiV83xJplYJhMb+mPPCl5kZuKmOxcXb7
cBEmFhSQMr/9v5QGg5KPFzrIcgcxtzGgPU5v+jCb2K1s8qzMSN7MPxVjaJkYPS7E
iIuu7vnJbcPGNxPFoA+es5HeSV9VTE7rdUZhLw3lvXxjJ9uxU+bW61c9ipSgO8sD
7lleqqCsyOQKtlC/1+48oATlORUK36EipnGWRjpGP//tCmlmsScIv6iuwImmg3fo
Wp+5jCPpY/1SfeqDgd81LzF6V1SUx/P1Za/AsJyTzSd49DcGbW+K10pWXCd+wNSk
HMPHQBQvF4D41ixDC6uPGejQuEfm6upAtxD1AgMBAAGgADANBgkqhkiG9w0BAQsF
AAOCAQEAHrp6J6uBXBs7HyhXISzG19CDqrjb8kfI5XgzcplWjdHNzQ2/bzEqFARl
a/f7h7Z7EFHR8gsoY1GExKHpb0KJdbnCGcSsdLuMmGWHZcaSuDZk5OWIBe4h7cdH
Bd9ou+909iNymqVBXodW16lYLa1//vR2m58WkZI4v6X1VdFgsfKzzyd/OIYKVGnV
bECja7GJzfj3qPL/NM2afq3VFvnya1BXMzNExNCFFhCidIZFqZqSBsp4uAxZs/sG
IAU+/OZXBeKnQh6Qj00ICso+v0Mhy6A8PC7f+5NQxE3V6wvR/hF24rCkx8tzEIsG
Vh3j8j6MwKsHohs77AavtLGEKtBE9w==
-----END CERTIFICATE REQUEST-----
28 changes: 28 additions & 0 deletions .travis/certs/client.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCuPxzAqMsogZru
ai/BXiV83xJplYJhMb+mPPCl5kZuKmOxcXb7cBEmFhSQMr/9v5QGg5KPFzrIcgcx
tzGgPU5v+jCb2K1s8qzMSN7MPxVjaJkYPS7EiIuu7vnJbcPGNxPFoA+es5HeSV9V
TE7rdUZhLw3lvXxjJ9uxU+bW61c9ipSgO8sD7lleqqCsyOQKtlC/1+48oATlORUK
36EipnGWRjpGP//tCmlmsScIv6iuwImmg3foWp+5jCPpY/1SfeqDgd81LzF6V1SU
x/P1Za/AsJyTzSd49DcGbW+K10pWXCd+wNSkHMPHQBQvF4D41ixDC6uPGejQuEfm
6upAtxD1AgMBAAECggEBAKy/OzUx4r/UxhHpylCNkuLakPmGVQ0g8hzQO9BtnJOp
iM6pa8lZUFcO+vH+rmLWJN3UYV9lK0z/52v9b8CqJvJS+w/23/CsIm4hLGkXfY/h
ai4ishP8P2d92rw9CyOfBQYfanzvEAVtfoslLPS4fr7olIGYuxHeuSpzwN5/0Szb
a8gjNzrHtUPCJFTVMEAIO2/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----
33 changes: 33 additions & 0 deletions .travis/certs/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

IP="roebert.nl"
SUBJECT_CA="/C=NL/ST=Amsterdam/L=Amsterdam/O=roebert/OU=CA/CN=$IP"
SUBJECT_SERVER="/C=NL/ST=Amsterdam/L=Amsterdam/O=roebert/OU=Server/CN=$IP"
SUBJECT_CLIENT="/C=NL/ST=Amsterdam/L=Amsterdam/O=roebert/OU=Client/CN=$IP"

function generate_CA () {
echo "$SUBJECT_CA"
openssl req -x509 -nodes -sha256 -newkey rsa:2048 -subj "$SUBJECT_CA" -days 365 -keyout ca.key -out ca.crt
}

function generate_server () {
echo "$SUBJECT_SERVER"
openssl req -nodes -sha256 -new -subj "$SUBJECT_SERVER" -keyout server.key -out server.csr
openssl x509 -req -sha256 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 365
}

function generate_client () {
echo "$SUBJECT_CLIENT"
openssl req -new -nodes -sha256 -subj "$SUBJECT_CLIENT" -out client.csr -keyout client.key
openssl x509 -req -sha256 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 365
}

function copy_keys_to_broker () {
mv ca.crt certs/
mv server.crt certs/
mv server.key certs/
}

generate_CA
generate_server
generate_client
37 changes: 18 additions & 19 deletions .travis/certs/server.crt
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDXjCCAkYCCQD+8B0SyjMz+DANBgkqhkiG9w0BAQsFADBxMQswCQYDVQQGEwJO
TDESMBAGA1UEBwwJQW1zdGVyZGFtMRcwFQYDVQQKDA5TdGV2ZW4gUm9lYmVydDET
MBEGA1UEAwwKcm9lYmVydC5ubDEgMB4GCSqGSIb3DQEJARYRc3RldmVuQHJvZWJl
cnQubmwwHhcNMjAwNDEyMTEyNzMwWhcNMjEwNDEyMTEyNzMwWjBxMQswCQYDVQQG
EwJOTDESMBAGA1UEBwwJQW1zdGVyZGFt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4X
DTIwMDQxMzE1MDAxMFoXDTIxMDQxMzE1MDAxMFowbTELMAkGA1UEBhMCTkwxEjAQ
BgNVBAgMCUFtc3RlcmRhbTESMBAGA1UEBwwJQW1zdGVyZGFtMRAwDgYDVQQKDAdy
b2ViZXJ0MQ8wDQYDVQQLDAZTZXJ2ZXIxEzARBgNVBAMMCnJvZWJlcnQubmwwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwMWSXSW5ddCKffp9+DgTswS5P
H2RmG4F7jEN+fAVsUUJhcuwxFUX64UKRX3HMMAGTrhPCZZxUmR/lrdlyZtgHjvMr
+aTmDJBS91wi6RVjFUdvPXeG40HMKNFq4qIQVVE/v+kVpO8UFNAhuek+WX42PgDs
1YiBdLNxIreGFKY+7g2VMt9AG8SHLypahXuYGC43gNvrBoaVJ4+AziLu9QHvwMP+
o1s2ovmfFEjdK0kDy9Ii3S3tHYKiNnGN11jJh+oTvBBZhL0kB67wtfaq3NKSlZIt
ZciNZwy+joSKDPjOckuEYnUBTHD1q1ZuayBqxGIWxZS1Sn61nzsznPVubXuHAgMB
AAEwDQYJKoZIhvcNAQELBQADggEBAH3giPUKTepWZxEzMBs8Gv7KukQeByv6h73u
BFKTmLnDe5yt8uEdg5vkIGW6hOLMprBBAakeAjFn7/i+FW64qS0/a3J5xStYXEn7
WUgYxSLC4Wxr5qflPPrZ0CcC62g6gcEYAy6Fd7Ega/CbZlB3ZFPbeJneVcSVvu8D
VI+mY+1K3R6Qjd0S5fz0TdXcyzM4cCPwai5vpXIa+neA88ZiHzvHR3fWKRjTX3L8
xHDc3PmSYltpoQlXJ0B/0A0idOOnOvVo/wGMFTBBHYcRpQiZ7yS0QkN6A322aP4+
78OPJmEb4+lOUstwvYBfzBfLhMVE+iVSlGDMR33YWFYv4uSrT3w=
-----END CERTIFICATE-----
17 changes: 17 additions & 0 deletions .travis/certs/server.csr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICsjCCAZoCAQAwbTELMAkGA1UEBhMCTkwxEjAQBgNVBAgMCUFtc3RlcmRhbTES
MBAGA1UEBwwJQW1zdGVyZGFtMRAwDgYDVQQKDAdyb2ViZXJ0MQ8wDQYDVQQLDAZT
ZXJ2ZXIxEzARBgNVBAMMCnJvZWJlcnQubmwwggEiMA0GCSqGSIb3DQEBAQUAA4IB
DwAwggEKAoIBAQCwMWSXSW5ddCKffp9+DgTswS5PH2RmG4F7jEN+fAVsUUJhcuwx
FUX64UKRX3HMMAGTrhPCZZxUmR/lrdlyZtgHjvMr+aTmDJBS91wi6RVjFUdvPXeG
40HMKNFq4qIQVVE/v+kVpO8UFNAhuek+WX42PgDs1YiBdLNxIreGFKY+7g2VMt9A
G8SHLypahXuYGC43gNvrBoaVJ4+AziLu9QHvwMP+o1s2ovmfFEjdK0kDy9Ii3S3t
HYKiNnGN11jJh+oTvBBZhL0kB67wtfaq3NKSlZItZciNZwy+joSKDPjOckuEYnUB
THD1q1ZuayBqxGIWxZS1Sn61nzsznPVubXuHAgMBAAGgADANBgkqhkiG9w0BAQsF
AAOCAQEAoI+Uk+TD4voUtwJ62Oj7rBFWWfbXeLcgG38QqWgXBAv48lcpKOtbGIag
BFqNtjWExf1PquO3cZG9fDBdtP/phgHJ3Bo2awIVvRXdIHC+xHvSHk30DZbDhOLl
Pef+wCxTX4+kM2bUIfZXpXj+pcziW2Ec0JO7o1p37G64smDvzqWrOfnaXpPT8PxG
SJpRtQ/9H25ksdR4fLuFLZS/Nv5VlUdTcwcHLw9j7WFc4Ojq6xMHRKRyuYJzbcCV
772CC+qq8Vp0vX+mwvybE4Dt9HJ/lGhu+jlmZnqC5A6Xmd3vi/eTILfJB9PnDyd9
nn664E0RTwvLaUYq4OpONVtEYYaXng==
-----END CERTIFICATE REQUEST-----
52 changes: 26 additions & 26 deletions .travis/certs/server.key
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANB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hhF7PNwyfT1RC5CB7pdd/oRLy9uhU5yc+pXUKXZ97fUqPUpr47
77EFM3df7pnhwZmww9WNixA/
-----END PRIVATE KEY-----
1 change: 0 additions & 1 deletion .travis/generate.txt

This file was deleted.

14 changes: 9 additions & 5 deletions .travis/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# Setup
max_inflight_messages 20
max_queued_messages 1000
allow_anonymous true
allow_zero_length_clientid false

# Using ports 1884 and 8884, as the default ports seem to already be in use on Travis

# Plain
bind_address 0.0.0.0
port 1883
bind_address localhost
port 1884
protocol mqtt

# SSL
listener 8883 0.0.0.0
listener 8884 localhost
protocol mqtt
cafile .travis/certs/server.crt
cafile .travis/certs/ca.crt
certfile .travis/certs/server.crt
keyfile .travis/certs/server.key

#log_dest none
log_dest none
14 changes: 7 additions & 7 deletions Tests/MQTTNIOTests/Core/MQTTNIOTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ class MQTTNIOTestCase: XCTestCase {

var plainClient: MQTTClient {
return MQTTClient(configuration: .init(
target: .host("0.0.0.0", port: 1883)
target: .host("localhost", port: 1884)
), eventLoopGroup: group)
}

var sslNoVerifyClient: MQTTClient {
return MQTTClient(configuration: .init(
target: .host("0.0.0.0", port: 8883),
target: .host("localhost", port: 8884),
tls: .forClient(certificateVerification: .none)
), eventLoopGroup: group)
}
Expand All @@ -41,14 +41,14 @@ class MQTTNIOTestCase: XCTestCase {
.deletingLastPathComponent()
.deletingLastPathComponent()
.deletingLastPathComponent()
let certificateURL = rootDir.appendingPathComponent(".travis/certs/server.crt")
let certificate = try! NIOSSLCertificate.fromPEMFile(certificateURL.path)[0]
let caCertifcateURL = rootDir.appendingPathComponent(".travis/certs/ca.crt")
let caCertificate = try! NIOSSLCertificate.fromPEMFile(caCertifcateURL.path)[0]

return MQTTClient(configuration: .init(
target: .host("0.0.0.0", port: 8883),
target: .host("localhost", port: 8884),
tls: .forClient(
certificateVerification: .noHostnameVerification,
trustRoots: .certificates([certificate])
trustRoots: .certificates([caCertificate])
)
), eventLoopGroup: group)
}
Expand All @@ -67,7 +67,7 @@ class MQTTNIOTestCase: XCTestCase {
let isLoggingConfigured: Bool = {
LoggingSystem.bootstrap { label in
var handler = StreamLogHandler.standardOutput(label: label)
handler.logLevel = .trace
handler.logLevel = .error
return handler
}
return true
Expand Down
6 changes: 3 additions & 3 deletions Tests/MQTTNIOTests/Core/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ func assertFailure<Value>(_ result: Result<Value, Error>, file: StaticString = #

extension XCTestCase {
@discardableResult
func wait<T>(for future: EventLoopFuture<T>, timeout: TimeInterval = 2, file: StaticString = #file, line: UInt = #line) -> T {
var value: T!
func wait<T>(for future: EventLoopFuture<T>, timeout: TimeInterval = 2, file: StaticString = #file, line: UInt = #line) -> T? {
var value: T?

let expectation = XCTestExpectation(description: "Waiting for future completion")
future.whenComplete { result in
assertSuccess(result, file: file, line: line)
expectation.fulfill()

value = try! result.get()
value = try? result.get()
}

let expectationResult = XCTWaiter.wait(for: [expectation], timeout: timeout)
Expand Down
Loading

0 comments on commit 1fb0b83

Please sign in to comment.