1
'''test_cr_systemd.py: tests for the cr_systemd module'''
3
# Copyright (C) 2015 Canonical Ltd.
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 3 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
from clickreviews.cr_systemd import ClickReviewSystemd
18
import clickreviews.cr_tests as cr_tests
21
class TestClickReviewSystemd(cr_tests.TestClickReview):
22
"""Tests for the lint review tool."""
24
# Monkey patch various file access classes. stop() is handled with
25
# addCleanup in super()
29
def _set_service(self, key, value, name=None):
36
self.set_test_pkg_yaml("services", [d])
38
def test_check_required(self):
39
'''Test check_required() - has start and description'''
40
self.set_test_systemd(self.default_appname,
43
self.set_test_systemd(self.default_appname,
46
c = ClickReviewSystemd(self.test_name)
49
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
50
self.check_results(r, expected_counts)
52
def test_check_required_empty_value(self):
53
'''Test check_required() - empty start'''
54
self.set_test_systemd(self.default_appname,
57
self.set_test_systemd(self.default_appname,
60
c = ClickReviewSystemd(self.test_name)
63
expected_counts = {'info': None, 'warn': 0, 'error': 1}
64
self.check_results(r, expected_counts)
66
def test_check_required_bad_value(self):
67
'''Test check_required() - bad start'''
68
self.set_test_systemd(self.default_appname,
71
self.set_test_systemd(self.default_appname,
74
c = ClickReviewSystemd(self.test_name)
77
expected_counts = {'info': None, 'warn': 0, 'error': 1}
78
self.check_results(r, expected_counts)
80
def test_check_required_multiple(self):
81
'''Test check_required() - multiple'''
82
self.set_test_systemd(self.default_appname,
85
self.set_test_systemd(self.default_appname,
88
c = ClickReviewSystemd(self.test_name)
91
expected_counts = {'info': -1, 'warn': 0, 'error': 0}
92
self.check_results(r, expected_counts)
94
def test_check_required_multiple(self):
95
'''Test check_required() - multiple with nonexistent'''
96
self.set_test_systemd(self.default_appname,
99
self.set_test_systemd(self.default_appname,
102
self.set_test_systemd(self.default_appname,
105
c = ClickReviewSystemd(self.test_name)
108
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
109
self.check_results(r, expected_counts)
111
def test_check_optional_none(self):
112
'''Test check_optional() - start only'''
113
self.set_test_systemd(self.default_appname,
116
c = ClickReviewSystemd(self.test_name)
119
expected_counts = {'info': 3, 'warn': 0, 'error': 0}
120
self.check_results(r, expected_counts)
122
def test_check_optional_stop_empty(self):
123
'''Test check_optional() - with empty stop'''
124
self.set_test_systemd(self.default_appname,
127
self.set_test_systemd(self.default_appname,
130
c = ClickReviewSystemd(self.test_name)
133
expected_counts = {'info': None, 'warn': 0, 'error': 1}
134
self.check_results(r, expected_counts)
136
def test_check_optional_stop_bad(self):
137
'''Test check_optional() - with bad stop'''
138
self.set_test_systemd(self.default_appname,
141
self.set_test_systemd(self.default_appname,
144
c = ClickReviewSystemd(self.test_name)
147
expected_counts = {'info': None, 'warn': 0, 'error': 1}
148
self.check_results(r, expected_counts)
150
def test_check_optional_stop_nonexistent(self):
151
'''Test check_optional() - with stop plus nonexistent'''
152
self.set_test_systemd(self.default_appname,
155
self.set_test_systemd(self.default_appname,
158
self.set_test_systemd(self.default_appname,
161
c = ClickReviewSystemd(self.test_name)
164
expected_counts = {'info': 3, 'warn': 0, 'error': 0}
165
self.check_results(r, expected_counts)
167
def test_check_optional_stop_without_start(self):
168
'''Test check_optional() - with stop, no start'''
169
self.set_test_systemd(self.default_appname,
172
c = ClickReviewSystemd(self.test_name)
175
expected_counts = {'info': 3, 'warn': 0, 'error': 0}
176
self.check_results(r, expected_counts)
178
def test_check_optional_stop_without_start2(self):
179
'''Test check_optional() - with stop, nonexistent, no start'''
180
self.set_test_systemd(self.default_appname,
183
self.set_test_systemd(self.default_appname,
186
c = ClickReviewSystemd(self.test_name)
189
expected_counts = {'info': 3, 'warn': 0, 'error': 0}
190
self.check_results(r, expected_counts)
192
def test_check_unknown(self):
193
'''Test check_unknown()'''
194
self.set_test_systemd(self.default_appname,
197
c = ClickReviewSystemd(self.test_name)
200
expected_counts = {'info': 0, 'warn': 1, 'error': 0}
201
self.check_results(r, expected_counts)
203
def test_check_unknown_multiple(self):
204
'''Test check_unknown() - multiple with nonexistent'''
205
self.set_test_systemd(self.default_appname,
208
self.set_test_systemd(self.default_appname,
211
self.set_test_systemd(self.default_appname,
214
c = ClickReviewSystemd(self.test_name)
217
expected_counts = {'info': 0, 'warn': 1, 'error': 0}
218
self.check_results(r, expected_counts)
220
def test_check_peer_hooks(self):
221
'''Test check_peer_hooks()'''
222
self.set_test_systemd(self.default_appname,
225
c = ClickReviewSystemd(self.test_name)
227
# create a new hooks database for our peer hooks tests
231
tmp["snappy-systemd"] = "meta/foo.snappy-systemd"
234
tmp["apparmor"] = "meta/foo.apparmor"
236
# update the manifest and test_manifest
237
c.manifest["hooks"][self.default_appname] = tmp
238
self._update_test_manifest()
243
# We should end up with 2 info
244
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
245
self.check_results(r, expected_counts)
247
def test_check_peer_hooks2(self):
248
'''Test check_peer_hooks() - apparmor-profile'''
249
self.set_test_systemd(self.default_appname,
252
c = ClickReviewSystemd(self.test_name)
254
# create a new hooks database for our peer hooks tests
258
tmp["snappy-systemd"] = "meta/foo.snappy-systemd"
261
tmp["apparmor-profile"] = "meta/foo.profile"
263
# update the manifest and test_manifest
264
c.manifest["hooks"][self.default_appname] = tmp
265
self._update_test_manifest()
270
# We should end up with 2 info
271
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
272
self.check_results(r, expected_counts)
274
def test_check_peer_hooks_disallowed(self):
275
'''Test check_peer_hooks() - disallowed'''
276
self.set_test_systemd(self.default_appname,
279
c = ClickReviewSystemd(self.test_name)
281
# create a new hooks database for our peer hooks tests
285
tmp["snappy-systemd"] = "meta/foo.snappy-systemd"
288
tmp["apparmor"] = "meta/foo.apparmor"
290
# add something not allowed
291
tmp["bin-path"] = "bin/bar"
293
c.manifest["hooks"][self.default_appname] = tmp
294
self._update_test_manifest()
299
expected_counts = {'info': None, 'warn': 0, 'error': 1}
300
self.check_results(r, expected_counts)
302
def test_check_peer_hooks_disallowed2(self):
303
'''Test check_peer_hooks() - disallowed (nonexistent)'''
304
self.set_test_systemd(self.default_appname,
307
c = ClickReviewSystemd(self.test_name)
309
# create a new hooks database for our peer hooks tests
313
tmp["snappy-systemd"] = "meta/foo.snappy-systemd"
316
tmp["apparmor"] = "meta/foo.apparmor"
318
# add something not allowed
319
tmp["nonexistent"] = "nonexistent-hook"
321
c.manifest["hooks"][self.default_appname] = tmp
322
self._update_test_manifest()
327
expected_counts = {'info': None, 'warn': 0, 'error': 1}
328
self.check_results(r, expected_counts)
330
def test_check_service_description(self):
331
'''Test check_service_description()'''
332
self.set_test_systemd(self.default_appname,
335
c = ClickReviewSystemd(self.test_name)
336
c.check_service_description()
338
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
339
self.check_results(r, expected_counts)
341
def test_check_service_description_unspecified(self):
342
'''Test check_service_description() - unspecified'''
343
self.set_test_systemd(self.default_appname,
346
c = ClickReviewSystemd(self.test_name)
347
c.check_service_description()
349
expected_counts = {'info': 0, 'warn': 0, 'error': 1}
350
self.check_results(r, expected_counts)
352
def test_check_service_description_empty(self):
353
'''Test check_service_description() - empty'''
354
self.set_test_systemd(self.default_appname,
357
c = ClickReviewSystemd(self.test_name)
358
c.check_service_description()
360
expected_counts = {'info': None, 'warn': 0, 'error': 1}
361
self.check_results(r, expected_counts)
363
def test_check_service_start(self):
364
'''Test check_service_start()'''
365
self.set_test_systemd(self.default_appname,
368
c = ClickReviewSystemd(self.test_name)
369
c.check_service_start()
371
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
372
self.check_results(r, expected_counts)
374
def test_check_service_start_unspecified(self):
375
'''Test check_service_start() - unspecified'''
376
self.set_test_systemd(self.default_appname,
379
c = ClickReviewSystemd(self.test_name)
380
c.check_service_start()
382
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
383
self.check_results(r, expected_counts)
385
def test_check_service_start_empty(self):
386
'''Test check_service_start() - empty'''
387
self.set_test_systemd(self.default_appname,
390
c = ClickReviewSystemd(self.test_name)
391
c.check_service_start()
393
expected_counts = {'info': None, 'warn': 0, 'error': 1}
394
self.check_results(r, expected_counts)
396
def test_check_service_start_absolute_path(self):
397
'''Test check_service_start() - absolute path'''
398
self.set_test_systemd(self.default_appname,
400
"/foo/bar/some/start")
401
c = ClickReviewSystemd(self.test_name)
402
c.check_service_start()
404
expected_counts = {'info': None, 'warn': 0, 'error': 1}
405
self.check_results(r, expected_counts)
407
def test_check_service_stop(self):
408
'''Test check_service_stop()'''
409
self.set_test_systemd(self.default_appname,
412
c = ClickReviewSystemd(self.test_name)
413
c.check_service_stop()
415
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
416
self.check_results(r, expected_counts)
418
def test_check_service_stop_unspecified(self):
419
'''Test check_service_stop() - unspecified'''
420
self.set_test_systemd(self.default_appname,
423
c = ClickReviewSystemd(self.test_name)
424
c.check_service_stop()
426
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
427
self.check_results(r, expected_counts)
429
def test_check_service_stop_empty(self):
430
'''Test check_service_stop() - empty'''
431
self.set_test_systemd(self.default_appname,
434
c = ClickReviewSystemd(self.test_name)
435
c.check_service_stop()
437
expected_counts = {'info': None, 'warn': 0, 'error': 1}
438
self.check_results(r, expected_counts)
440
def test_check_service_stop_absolute_path(self):
441
'''Test check_service_stop() - absolute path'''
442
self.set_test_systemd(self.default_appname,
444
"/foo/bar/some/stop")
445
c = ClickReviewSystemd(self.test_name)
446
c.check_service_stop()
448
expected_counts = {'info': None, 'warn': 0, 'error': 1}
449
self.check_results(r, expected_counts)
451
def test_check_service_poststop(self):
452
'''Test check_service_poststop()'''
453
self.set_test_systemd(self.default_appname,
456
c = ClickReviewSystemd(self.test_name)
457
c.check_service_poststop()
459
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
460
self.check_results(r, expected_counts)
462
def test_check_service_poststop_unspecified(self):
463
'''Test check_service_poststop() - unspecified'''
464
self.set_test_systemd(self.default_appname,
467
c = ClickReviewSystemd(self.test_name)
468
c.check_service_poststop()
470
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
471
self.check_results(r, expected_counts)
473
def test_check_service_poststop_empty(self):
474
'''Test check_service_poststop() - empty'''
475
self.set_test_systemd(self.default_appname,
478
c = ClickReviewSystemd(self.test_name)
479
c.check_service_poststop()
481
expected_counts = {'info': None, 'warn': 0, 'error': 1}
482
self.check_results(r, expected_counts)
484
def test_check_service_poststop_absolute_path(self):
485
'''Test check_service_poststop() - absolute path'''
486
self.set_test_systemd(self.default_appname,
488
"/foo/bar/some/poststop")
489
c = ClickReviewSystemd(self.test_name)
490
c.check_service_poststop()
492
expected_counts = {'info': None, 'warn': 0, 'error': 1}
493
self.check_results(r, expected_counts)
495
def test_check_service_stop_timeout(self):
496
'''Test check_service_stop_timeout()'''
497
self.set_test_systemd(self.default_appname,
500
self.set_test_systemd(self.default_appname,
503
self.set_test_systemd(self.default_appname,
506
c = ClickReviewSystemd(self.test_name)
507
c.check_service_stop_timeout()
509
expected_counts = {'info': 1, 'warn': 0, 'error': 0}
510
self.check_results(r, expected_counts)
512
def test_check_service_stop_timeout_empty(self):
513
'''Test check_service_stop_timeout() - empty'''
514
self.set_test_systemd(self.default_appname,
517
self.set_test_systemd(self.default_appname,
520
self.set_test_systemd(self.default_appname,
523
c = ClickReviewSystemd(self.test_name)
524
c.check_service_stop_timeout()
526
expected_counts = {'info': None, 'warn': 0, 'error': 1}
527
self.check_results(r, expected_counts)
529
def test_check_service_stop_timeout_bad(self):
530
'''Test check_service_stop_timeout() - bad'''
531
self.set_test_systemd(self.default_appname,
534
self.set_test_systemd(self.default_appname,
537
self.set_test_systemd(self.default_appname,
540
c = ClickReviewSystemd(self.test_name)
541
c.check_service_stop_timeout()
543
expected_counts = {'info': None, 'warn': 0, 'error': 1}
544
self.check_results(r, expected_counts)
546
def test_check_service_stop_timeout_range_low(self):
547
'''Test check_service_stop_timeout() - out of range (low)'''
548
self.set_test_systemd(self.default_appname,
551
self.set_test_systemd(self.default_appname,
554
self.set_test_systemd(self.default_appname,
557
c = ClickReviewSystemd(self.test_name)
558
c.check_service_stop_timeout()
560
expected_counts = {'info': None, 'warn': 0, 'error': 1}
561
self.check_results(r, expected_counts)
563
def test_check_service_stop_timeout_range_high(self):
564
'''Test check_service_stop_timeout() - out of range (high)'''
565
self.set_test_systemd(self.default_appname,
568
self.set_test_systemd(self.default_appname,
571
self.set_test_systemd(self.default_appname,
574
c = ClickReviewSystemd(self.test_name)
575
c.check_service_stop_timeout()
577
expected_counts = {'info': None, 'warn': 0, 'error': 1}
578
self.check_results(r, expected_counts)
580
def test_check_snappy_service_description(self):
581
'''Test check_snappy_service_description()'''
582
self._set_service("description", "some description")
583
c = ClickReviewSystemd(self.test_name)
584
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
585
c.check_snappy_service_description()
587
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
588
self.check_results(r, expected_counts)
590
def test_check_snappy_service_description_unspecified(self):
591
'''Test check_snappy_service_description() - unspecified'''
592
# self._set_service("description", None)
593
c = ClickReviewSystemd(self.test_name)
594
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
595
c.check_snappy_service_description()
597
# required check is done elsewhere, so no error
598
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
599
self.check_results(r, expected_counts)
601
def test_check_snappy_service_description_empty(self):
602
'''Test check_snappy_service_description() - empty'''
603
self._set_service("description", "")
604
c = ClickReviewSystemd(self.test_name)
605
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
606
c.check_snappy_service_description()
608
expected_counts = {'info': None, 'warn': 0, 'error': 1}
609
self.check_results(r, expected_counts)
611
def test_check_snappy_service_start(self):
612
'''Test check_snappy_service_start()'''
613
self._set_service("start", "some/start")
614
c = ClickReviewSystemd(self.test_name)
615
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
616
c.check_snappy_service_start()
618
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
619
self.check_results(r, expected_counts)
621
def test_check_snappy_service_start_unspecified(self):
622
'''Test check_snappy_service_start() - unspecified'''
623
# self._set_service("start", None)
624
c = ClickReviewSystemd(self.test_name)
625
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
626
c.check_snappy_service_start()
628
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
629
self.check_results(r, expected_counts)
631
def test_check_snappy_service_start_empty(self):
632
'''Test check_snappy_service_start() - empty'''
633
self._set_service("start", "")
634
c = ClickReviewSystemd(self.test_name)
635
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
636
c.check_snappy_service_start()
638
expected_counts = {'info': None, 'warn': 0, 'error': 1}
639
self.check_results(r, expected_counts)
641
def test_check_snappy_service_start_absolute_path(self):
642
'''Test check_snappy_service_start() - absolute path'''
643
self._set_service("start", "/foo/bar/some/start")
644
c = ClickReviewSystemd(self.test_name)
645
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
646
c.check_snappy_service_start()
648
expected_counts = {'info': None, 'warn': 0, 'error': 1}
649
self.check_results(r, expected_counts)
651
def test_check_snappy_service_stop(self):
652
'''Test check_snappy_service_stop()'''
653
self._set_service("stop", "some/stop")
654
c = ClickReviewSystemd(self.test_name)
655
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
656
c.check_snappy_service_stop()
658
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
659
self.check_results(r, expected_counts)
661
def test_check_snappy_service_stop_unspecified(self):
662
'''Test check_snappy_service_stop() - unspecified'''
663
# self._set_service("stop", None)
664
c = ClickReviewSystemd(self.test_name)
665
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
666
c.check_snappy_service_stop()
668
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
669
self.check_results(r, expected_counts)
671
def test_check_snappy_service_stop_empty(self):
672
'''Test check_snappy_service_stop() - empty'''
673
self._set_service("stop", "")
674
c = ClickReviewSystemd(self.test_name)
675
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
676
c.check_snappy_service_stop()
678
expected_counts = {'info': None, 'warn': 0, 'error': 1}
679
self.check_results(r, expected_counts)
681
def test_check_snappy_service_stop_absolute_path(self):
682
'''Test check_snappy_service_stop() - absolute path'''
683
self._set_service("stop", "/foo/bar/some/stop")
684
c = ClickReviewSystemd(self.test_name)
685
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
686
c.check_snappy_service_stop()
688
expected_counts = {'info': None, 'warn': 0, 'error': 1}
689
self.check_results(r, expected_counts)
691
def test_check_snappy_service_poststop(self):
692
'''Test check_snappy_service_poststop()'''
693
self._set_service("poststop", "some/poststop")
694
c = ClickReviewSystemd(self.test_name)
695
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
696
c.check_snappy_service_poststop()
698
expected_counts = {'info': 2, 'warn': 0, 'error': 0}
699
self.check_results(r, expected_counts)
701
def test_check_snappy_service_poststop_unspecified(self):
702
'''Test check_snappy_service_poststop() - unspecified'''
703
# self._set_service("poststop", None)
704
c = ClickReviewSystemd(self.test_name)
705
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
706
c.check_snappy_service_poststop()
708
expected_counts = {'info': 0, 'warn': 0, 'error': 0}
709
self.check_results(r, expected_counts)
711
def test_check_snappy_service_poststop_empty(self):
712
'''Test check_snappy_service_poststop() - empty'''
713
self._set_service("poststop", "")
714
c = ClickReviewSystemd(self.test_name)
715
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
716
c.check_snappy_service_poststop()
718
expected_counts = {'info': None, 'warn': 0, 'error': 1}
719
self.check_results(r, expected_counts)
721
def test_check_snappy_service_poststop_absolute_path(self):
722
'''Test check_snappy_service_poststop() - absolute path'''
723
self._set_service("poststop", "/foo/bar/some/poststop")
724
c = ClickReviewSystemd(self.test_name)
725
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
726
c.check_snappy_service_poststop()
728
expected_counts = {'info': None, 'warn': 0, 'error': 1}
729
self.check_results(r, expected_counts)
731
def test_check_snappy_service_stop_timeout(self):
732
'''Test check_snappy_service_stop_timeout()'''
733
self._set_service(key="start", value="bin/foo")
734
self._set_service(key="description", value="something")
735
self._set_service(key="stop-timeout", value=30)
736
c = ClickReviewSystemd(self.test_name)
737
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
738
c.check_snappy_service_stop_timeout()
740
expected_counts = {'info': 1, 'warn': 0, 'error': 0}
741
self.check_results(r, expected_counts)
743
def test_check_snappy_service_stop_timeout_empty(self):
744
'''Test check_snappy_service_stop_timeout() - empty'''
745
self._set_service(key="start", value="bin/foo")
746
self._set_service(key="description", value="something")
747
self._set_service(key="stop-timeout", value="")
748
c = ClickReviewSystemd(self.test_name)
749
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
750
c.check_snappy_service_stop_timeout()
752
expected_counts = {'info': None, 'warn': 0, 'error': 1}
753
self.check_results(r, expected_counts)
755
def test_check_snappy_service_stop_timeout_bad(self):
756
'''Test check_snappy_service_stop_timeout() - bad'''
757
self._set_service(key="start", value="bin/foo")
758
self._set_service(key="description", value="something")
759
self._set_service(key="stop-timeout", value="a")
760
c = ClickReviewSystemd(self.test_name)
761
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
762
c.check_snappy_service_stop_timeout()
764
expected_counts = {'info': None, 'warn': 0, 'error': 1}
765
self.check_results(r, expected_counts)
767
def test_check_snappy_service_stop_timeout_range_low(self):
768
'''Test check_snappy_service_stop_timeout() - out of range (low)'''
769
self._set_service(key="start", value="bin/foo")
770
self._set_service(key="description", value="something")
771
self._set_service(key="stop-timeout", value=-1)
772
c = ClickReviewSystemd(self.test_name)
773
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
774
c.check_snappy_service_stop_timeout()
776
expected_counts = {'info': None, 'warn': 0, 'error': 1}
777
self.check_results(r, expected_counts)
779
def test_check_snappy_service_stop_timeout_range_high(self):
780
'''Test check_snappy_service_stop_timeout() - out of range (high)'''
781
self._set_service(key="start", value="bin/foo")
782
self._set_service(key="description", value="something")
783
self._set_service(key="stop-timeout", value=61)
784
c = ClickReviewSystemd(self.test_name)
785
c.systemd_files['foo'] = "meta/foo.snappy-systemd"
786
c.check_snappy_service_stop_timeout()
788
expected_counts = {'info': None, 'warn': 0, 'error': 1}
789
self.check_results(r, expected_counts)