add proxy check management and change API interface
[curl-de-sac.git] / webtest / cds_test02.php
index bcbacbb..e5fc092 100755 (executable)
@@ -2,11 +2,17 @@
 <?php
 
 define('WEB_URL', 'http://localhost/curl-de-sac');
-define('TOR_CHK_URL', 'http://localhost/curl-de-sac/test/tor_mock.php');
 define('DBG_LEVEL', 0);
 
-require_once('Obj/curl-de-sac.phh');
-require_once('Obj/curl-de-brisk.phh');
+$G_base = "./";
+
+function log_cds()
+{
+    printf("log_cds\n");
+}
+
+require_once($G_base . 'Obj/curl-de-sac.phh');
+require_once($G_base . 'Obj/curl-de-brisk.phh');
 
 class Brisk_mock {
     function cds_postprocess($user_idx, $user_sess, $conn_ip, $is_tor)
@@ -46,7 +52,7 @@ function main()
          if ($i == 2) {
              // Case OK
             printf("MAIN: load 'tor_chk'\n");
-            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.213") == FALSE) {
+            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.213", TRUE) == FALSE) {
                 printf("MAIN: push 'tor_chk' command failed\n");
                 exit(123);
             }
@@ -55,7 +61,7 @@ function main()
          else if ($i == 4) {
              // Case Malformed output
             printf("MAIN: load 'tor_chk'\n");
-            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.214") == FALSE) {
+            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.214", FALSE) == FALSE) {
                 printf("MAIN: push 'tor_chk' command failed\n");
                 exit(123);
             }
@@ -63,7 +69,7 @@ function main()
          else if ($i == 6) {
              // Case NO
             printf("MAIN: load 'tor_chk'\n");
-            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.215") == FALSE) {
+            if ($cds->execute("tor_chk", $brisk, 24, "caffe", "178.162.193.215", TRUE) == FALSE) {
                 printf("MAIN: push 'tor_chk' command failed\n");
                 exit(123);
             }