root/test/t/105_crl_test.t

Revision c35ae3a734c66c3de2052ccd0b30da5672a446d1, 0.7 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 8 years ago)

closes #206

  • Property mode set to 100644
Line 
1 use Test::More tests => 3;
2 use XML::LibXML;
3 use XML::LibXML::XPathContext;
4 use testconfig;
5 use apiclient;
6
7 use strict;
8 my ($c, @r);
9 my $xp = XML::LibXML->new();
10 my $xpc = XML::LibXML::XPathContext->new();
11
12 ok(start_noit("105", { logs_debug => { '' => 'false' } }), 'starting noit');
13 sleep(1);
14 $c = apiclient->new('localhost', $NOIT_API_PORT);
15 @r = $c->get("/checks/show/f7cea020-f19d-11dd-85a6-cb6d3a2207dc");
16 is($r[0], 404, 'request works with usable key');
17
18 $c = apiclient->new('localhost', $NOIT_API_PORT,
19                     { 'key' => '../badclient.key',
20                       'cert' => '../badclient.crt' });
21 eval {
22     @r = $c->get("/checks/show/f7cea020-f19d-11dd-85a6-cb6d3a2207dc");
23 };
24 like($@, qr/SSL/, 'request fails with revoked key');
25
26 1;
Note: See TracBrowser for help on using the browser.