]>
git.defcon.no Git - hermes/blob - api/t/domain.t
69882035b81f896bdb7d612ad8bc740cf212025d
4 use Test
::More
'no_plan';
7 # Configuration variables defined in tests_common
8 # Make sure those are updated/set correctly..
12 # Further variables defined in tests_common:
18 my ($data, $temp, $test_domain, $test_remote_domain );
20 isa_ok
( $g_ua, 'LWP::UserAgent', '$g_ua');
21 isa_ok
( $g_ua->cookie_jar, 'HTTP::Cookies', '$g_ua->cookies');
25 $data = exec_apinode
("domain/list", undef);
26 is
( $data->{'response'}, 'ok', 'domain/list result');
27 ok
($data->{'list'}, 'domain/list array');
29 # NOW: Set the $test_domain to something useful (i.e. the first reported domain)
30 $test_domain = $data->{'list'}[0];
31 ok
($test_domain, 'test_domain set.');
34 $data = exec_apinode
("domain/get_servers", { "domain" => $test_domain });
35 is
( $data->{'response'}, 'ok', 'domain/get_servers result');
36 ok
($data->{'servers'}->{'domain'}, 'domain/get_servers - domain');
37 ok
($data->{'servers'}->{'registrar'}, 'domain/get_servers - registrar');
38 ok
($data->{'servers'}->{'r_port'}, 'domain/get_servers - r_port');
39 ok
($data->{'servers'}->{'proxy'}, 'domain/get_servers - proxy');
40 ok
($data->{'servers'}->{'p_port'}, 'domain/get_servers - p_port');
41 ok
($data->{'servers'}->{'prov_url'}, 'domain/get_servers - prov_url');
44 $data = exec_apinode
("domain/set_servers", {
45 "domain" => $test_domain,
46 "registrar" => "registrar." . $test_domain,
48 "proxy" => "proxy." . $test_domain,
50 "prov_url" => "http://phone." . $test_domain . "/hermes/prov/",
53 is
( $data->{'response'}, 'ok', 'domain/set_servers result');
54 ok
($data->{'servers'}->{'domain'}, 'domain/set_servers - domain');
55 ok
($data->{'servers'}->{'registrar'}, 'domain/set_servers - registrar');
56 ok
($data->{'servers'}->{'r_port'}, 'domain/set_servers - r_port');
57 ok
($data->{'servers'}->{'proxy'}, 'domain/set_servers - proxy');
58 ok
($data->{'servers'}->{'p_port'}, 'domain/set_servers - p_port');
59 ok
($data->{'servers'}->{'prov_url'}, 'domain/set_servers - prov_url');