Skip to content

Commit f97a184

Browse files
authored
Merge pull request #29 from tarantool/fix-tests
Fix tests, update distros
2 parents a9dcc11 + f3d993d commit f97a184

File tree

4 files changed

+35
-45
lines changed

4 files changed

+35
-45
lines changed

.travis.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,16 @@ env:
1111
global:
1212
- PRODUCT=tarantool-mqtt
1313
matrix:
14-
# - OS=el DIST=6
1514
- OS=el DIST=7
16-
- OS=fedora DIST=24
17-
- OS=fedora DIST=25
18-
# - OS=ubuntu DIST=precise
19-
# - OS=ubuntu DIST=trusty
15+
- OS=fedora DIST=26
16+
- OS=fedora DIST=27
2017
- OS=ubuntu DIST=xenial
21-
- OS=ubuntu DIST=yakkety
22-
# - OS=debian DIST=wheezy
18+
- OS=ubuntu DIST=artful
19+
- OS=ubuntu DIST=bionic
20+
- OS=ubuntu DIST=cosmic
2321
- OS=debian DIST=jessie
2422
- OS=debian DIST=stretch
2523

26-
#matrix:
27-
# allow_failures:
28-
# - env: OS=el DIST=6
29-
# - env: OS=el DIST=7
30-
# - env: OS=fedora DIST=24
31-
# - env: OS=fedora DIST=25
32-
# - env: OS=ubuntu DIST=precise
33-
# - env: OS=ubuntu DIST=trusty
34-
# - env: OS=ubuntu DIST=xenial
35-
# - env: OS=ubuntu DIST=yakkety
36-
# - env: OS=debian DIST=wheezy
37-
# - env: OS=debian DIST=jessie
38-
# - env: OS=debian DIST=stretch
39-
4024
script:
4125
- git describe --long
4226
- git clone https://github.com/packpack/packpack.git packpack
@@ -49,7 +33,7 @@ deploy:
4933
# Deploy packages to PackageCloud
5034
- provider: packagecloud
5135
username: tarantool
52-
repository: "1_6"
36+
repository: "1_9"
5337
token: ${PACKAGECLOUD_TOKEN}
5438
dist: ${OS}/${DIST}
5539
package_glob: build/*.{rpm,deb,dsc}
@@ -59,7 +43,7 @@ deploy:
5943
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
6044
- provider: packagecloud
6145
username: tarantool
62-
repository: "1_7"
46+
repository: "1_10"
6347
token: ${PACKAGECLOUD_TOKEN}
6448
dist: ${OS}/${DIST}
6549
package_glob: build/*.{rpm,deb,dsc}
@@ -69,7 +53,7 @@ deploy:
6953
condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
7054
- provider: packagecloud
7155
username: tarantool
72-
repository: "1_8"
56+
repository: "2x"
7357
token: ${PACKAGECLOUD_TOKEN}
7458
dist: ${OS}/${DIST}
7559
package_glob: build/*.{rpm,deb,dsc}

debian/changelog

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
-- Vasiliy Soshnikov <dedok.mad@gmail.com> Sun, 8 Jul 2018 16:23:00 +0300
21
tarantool-mqtt (1.4.0-1) stable; urgency=medium
32
* Fixed: https://github.com/tarantool/mqtt/issues/14
43
* Fixed: https://github.com/tarantool/mqtt/issues/12
54
* Fixed: https://github.com/tarantool/mqtt/issues/11
65
* Fixed: https://github.com/tarantool/mqtt/issues/9
76

7+
-- Vasiliy Soshnikov <dedok.mad@gmail.com> Sun, 8 Jul 2018 16:23:00 +0300
8+
89
tarantool-mqtt (1.2.0-1) stable; urgency=medium
910
* Build issue have been fixed.
1011

1112
-- Vasiliy Soshnikov <dedok.mad@gmail.com> Sun, 2 Apr 2017 21:40:00 +0300
13+
1214
tarantool-mqtt (1.1.0-1) stable; urgency=medium
1315

1416
* RabbitMQ connection issue have been fixed.
1517
* Hight CPU usage issue have been fixed.
1618
* API errors hanling have been fixed.
1719

1820
-- Vasiliy Soshnikov <dedok.mad@gmail.com> Sun, 2 Apr 2017 19:24:00 +0300
21+
1922
tarantool-mqtt (1.0.0-1) unstable; urgency=medium
2023

2124
* Initial release.

mqtt/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,9 @@ mqtt_mt = {
492492
if (self.fiber ~= nil and self.fiber.cancel ~= nil) then
493493
self.fiber:cancel()
494494
end
495+
if next(getmetatable(self.mqtt)) == nil then
496+
return false, "already destroyed"
497+
end
495498
local ok, emsg = self.mqtt:destroy()
496499
self = nil
497500
return ok, emsg

test/api.lua

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@ local conn = mqtt.new()
4141

4242
assert(type(conn.VERSION) == 'string')
4343

44-
F(conn:on_connect(function(success, ret_code, message)
44+
F('on_connect', conn:on_connect(function(success, ret_code, message)
4545
if not success then
4646
print("can't connect msg = %s, ret_code = %d", message, ret_code)
4747
os.exit(1)
4848
end
4949
stat_inc('on_connect')
5050
end))
5151

52-
F(conn:on_publish(function(mid)
52+
F('on_publish', conn:on_publish(function(mid)
5353
stat_inc('on_publish')
5454
end))
5555

56-
F(conn:on_subscribe(function(mid, QoS)
56+
F('on_subscribe', conn:on_subscribe(function(mid, QoS)
5757
stat_inc('on_subscribe')
5858
end))
5959

60-
F(conn:on_unsubscribe(function(mid)
60+
F('on_unsubscribe', conn:on_unsubscribe(function(mid)
6161
stat_inc('on_unsubscribe')
6262
end))
6363

64-
F(conn:on_disconnect(
64+
F('on_disconnect', conn:on_disconnect(
6565
function(success, ret_code, message)
6666
if not success then
6767
print("can't connect msg = %s, ret_code = %d", message, ret_code)
@@ -71,7 +71,7 @@ F(conn:on_disconnect(
7171
end
7272
))
7373

74-
F(conn:on_message(
74+
F('on_message', conn:on_message(
7575
function(mid, topic, payload, qos, retain)
7676
stat_inc('on_message')
7777
stat[topic .. '_' .. payload] = {mid=mid}
@@ -89,24 +89,24 @@ E('reconnect', conn:reconnect())
8989

9090
-- Here is setup for defaul Rabbitmq MQTT provider.
9191
-- (!) Except. login_set [[
92-
F(conn:tls_insecure_set(false))
92+
F('tls_insecure_set', conn:tls_insecure_set(false))
9393
F('connect', conn:connect({host="127.0.0.1", port=1883}))
94-
F(conn:login_set('user', 'password'))
94+
F('login_set', conn:login_set('user', 'password'))
9595
-- ]]
9696

9797
F('reconnect', conn:reconnect())
9898

99-
F(conn:subscribe('some/topic'))
100-
F(conn:will_set('some/topic', 'str', 0, false))
101-
F(conn:will_clear())
102-
F(conn:unsubscribe('some/topic'))
99+
F('subscribe', conn:subscribe('some/topic'))
100+
F('will_set', conn:will_set('some/topic', 'str', 0, false))
101+
F('will_clear', conn:will_clear())
102+
F('unsubscribe', conn:unsubscribe('some/topic'))
103103

104-
F(conn:subscribe('channel/#'))
105-
F(conn:publish('channel/in_1', 'data_1', 0, false))
106-
F(conn:publish('channel/in_1', 'data_2', 0, false))
107-
F(conn:publish('channel/in_2', 'data_1', 0, false))
108-
F(conn:publish('channel/in_2', 'data_2', 0, false))
109-
F(conn:unsubscribe('channel/#'))
104+
F('subscribe', conn:subscribe('channel/#'))
105+
F('publish', conn:publish('channel/in_1', 'data_1', 0, false))
106+
F('publish', conn:publish('channel/in_1', 'data_2', 0, false))
107+
F('publish', conn:publish('channel/in_2', 'data_1', 0, false))
108+
F('publish', conn:publish('channel/in_2', 'data_2', 0, false))
109+
F('unsubscribe', conn:unsubscribe('channel/#'))
110110

111111
-- Join
112112
print ("[+] Join result")
@@ -122,7 +122,7 @@ assert(stat['channel/in_2_data_2'] ~= nil)
122122

123123
print ("[+] Done")
124124

125-
F(conn:destroy())
126-
F(conn:destroy())
125+
F('destroy', conn:destroy())
126+
E('destroy', conn:destroy())
127127

128128
os.exit(0)

0 commit comments

Comments
 (0)