-TODO: {
- local $TODO = 'auth/login not implemented yet';
- $response = $g_ua->get( $api_base . "auth/login?username=" . $api_user .
- "password=" . $api_pass . "&key=" . $api_key);
+login_apikey();
+
+# First: fetch a supported domain from the API...
+$data = exec_apinode("domain/list", undef);
+ok($data, 'domain/list JSON decode');
+is( $data->{'response'}, 'ok', 'domain/list result');
+ok($data->{'list'}, 'domain/list array');
+
+# NOW: Set the $test_domain to something useful (i.e. the first reported domain)
+$test_domain = $data->{'list'}[0];
+$test_remote_domain = "external." . $test_domain;