Mailinglist Archive: yast-commit (815 mails)

< Previous Next >
[yast-commit] r40016 - in /trunk/squid: src/ testsuite/tests/
  • From: dfiser@xxxxxxxxxxxxxxxx
  • Date: Mon, 06 Aug 2007 14:41:54 -0000
  • Message-id: <20070806144154.A6D77C8500@xxxxxxxxxxxxxxxx>
Author: dfiser
Date: Mon Aug  6 16:41:54 2007
New Revision: 40016

URL: http://svn.opensuse.org/viewcvs/yast?rev=40016&view=rev
Log:
Created testsuites for SquidACL and Squid (Get,Set,Modify... functions).
Testsuite SquidRead renamed to Squid-Read.
If user want to delete ACL or change its name than it's verified if it can affect any options. If it affects any options, user is asked for verification of the step or the step is not permited (in case of affected option http_access).
Added some verification code to Squid::Get/Modify functions.

Added:
    trunk/squid/testsuite/tests/Squid-Read.err
      - copied unchanged from r39866, trunk/squid/testsuite/tests/SquidRead.err
    trunk/squid/testsuite/tests/Squid-Read.out
      - copied, changed from r39866, trunk/squid/testsuite/tests/SquidRead.out
    trunk/squid/testsuite/tests/Squid-Read.ycp
      - copied unchanged from r39866, trunk/squid/testsuite/tests/SquidRead.ycp
    trunk/squid/testsuite/tests/Squid.err
    trunk/squid/testsuite/tests/Squid.out
    trunk/squid/testsuite/tests/Squid.ycp
    trunk/squid/testsuite/tests/SquidACL.err
    trunk/squid/testsuite/tests/SquidACL.out
    trunk/squid/testsuite/tests/SquidACL.ycp
Removed:
    trunk/squid/testsuite/tests/SquidRead.err
    trunk/squid/testsuite/tests/SquidRead.out
    trunk/squid/testsuite/tests/SquidRead.ycp
Modified:
    trunk/squid/src/Squid.ycp
    trunk/squid/src/SquidACL.ycp
    trunk/squid/src/complex.ycp
    trunk/squid/src/dialogs.ycp
    trunk/squid/src/popup_dialogs.ycp

Modified: trunk/squid/src/Squid.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/Squid.ycp?rev=40016&r1=40015&r2=40016&view=diff
==============================================================================
--- trunk/squid/src/Squid.ycp (original)
+++ trunk/squid/src/Squid.ycp Mon Aug  6 16:41:54 2007
@@ -132,6 +132,20 @@
 ];
 
 
+/**
+ * Same as splitstring(), but returns only non-empty strings.
+ */
+list<string> split(string str, string delim)
+{
+    return filter(string value, splitstring(str, delim),
+                {
+                    //y2debug("Squid::split value: %1, size(value): %2",value, size(value));
+                    return (size(value)>0);
+                });
+}
+
+
+
 
 global boolean Modified(){
     return modified;
@@ -172,25 +186,135 @@
 {
     return acls;
 }
+
 global map<string,any> GetACL(integer id_item)
 {
     return acls[id_item]:$[];
 }
+
 global void AddACL(string name, string type, list<string> options)
 {
     acls = add(acls, $[ "name" : name,
                         "type" : type,
                         "options" : options]);
 }
+
 global void ModifyACL(integer id_item, string name, string type, list<string> options)
 {
-    acls[id_item] = $[ "name" : name,
-                       "type" : type,
-                       "options" : options];
+    if (id_item >= 0 && id_item < size(acls)){
+        acls[id_item] = $[ "name" : name,
+                           "type" : type,
+                           "options" : options];
+    }
 }
+
 global void DelACL(integer id_item)
 {
-    acls = remove(acls, id_item);
+    if (id_item >= 0 && id_item < size(acls)){
+        acls = remove(acls, id_item);
+    }
+}
+
+
+/**
+ * Returns number of occurences of ACL (definition lines) in config file.
+ */
+global integer NumACLs(integer id_item)
+{
+    string acl = (acls[id_item]:$[])["name"]:""; //get name of acl
+    if (size(acl) == 0) return nil; //invalid id_item
+    integer ret = 0;
+
+    foreach (map<string, any> value, acls,
+        {
+            if (value["name"]:"" == acl)
+                ret = ret + 1;
+        });
+
+    y2debug("Squid::NumACLs() - acl: %1, num: %2", acl, ret);
+
+    return ret;
+}
+
+/**
+ * Returns list of options which use this ACL (identified by id_item).
+ * It's necessary to run this function before deleting ACL to know if
+ * any options are not affected.
+ */
+global list<string> ACLIsUsedBy(integer id_item)
+{
+    string acl = (GetACL(id_item))["name"]:"";
+    if (size(acl) == 0) return nil; //invalid id_item
+
+    list<string> params = [];
+    list<string> ret = [];
+
+    // options with format:
+    //      option_name something ACL ACL ACL ...
+    list<string> format1 = [
+        "no_cache", "cache",
+        "broken_vary_encoding",
+        "follow_x_forwarded_for",
+        //"http_access", -> cached in this module !!!
+        "http_reply_access",
+        "icp_access",
+        "htcp_access",
+        "miss_access",
+        "ident_lookup_access",
+        "log_access",
+        "always_direct",
+        "never_direct",
+        "snmp_access",
+        "broken_posts",
+        "deny_info"
+    ];
+    // options with format:
+    //      option_name something something ACL ACL ACL ...
+    list<string> format2 = [
+        "tcp_outgoing_tos",
+        "tcp_outgoing_address",
+        "reply_body_max_size",
+        "header_access",
+        "cache_peer_access",
+        "access_log"
+    ];
+
+    list<string> available_options = SCR::Dir(squid_path);
+
+    foreach (string value, (list<string>)merge(format1, format2),
+        {
+            if (contains(available_options, value)){
+                foreach (string val, (list<string>)SCR::Read( add(squid_path, value)),
+                    {
+                        params = remove(split(val, " \t"), 0); // remove first param
+                        if (contains(format2, value)){ // if it is format 2 remove also second param
+                            if (size(params) > 1){
+                                params = remove(params, 0);
+                            }else{
+                                break;
+                            }
+                        }
+
+                        if (contains(params, acl) || contains(params, "!"+acl)){
+                            ret = add(ret, value);
+                            break;
+                        }
+                    });
+            }
+        });
+
+    //http_access:
+    foreach (map<string, any> value, http_accesses,
+        {
+            if (contains(value["acl"]:[], acl) || contains(value["acl"]:[], "!"+acl)){
+                ret = add(ret, "http_access");
+                break;
+            }
+        });
+
+    y2debug("Squid::ACLIsUsedBy() - acl:%1, ret: %2", acl, ret);
+
+    return ret;
 }
 /******* ACL END *******/
 
@@ -199,29 +323,42 @@
 {
     return http_accesses;
 }
+
 global map<string,any> GetHttpAccess(integer id_item)
 {
     return http_accesses[id_item]:$[];
 }
+
 global void AddHttpAccess(boolean allow, list<string> acl)
 {
     http_accesses = add(http_accesses, $["allow" : allow,
                                          "acl" : acl]);
 }
+
 global void ModifyHttpAccess(integer id_item, boolean allow, list<string> acl)
 {
-    http_accesses[id_item] = $["allow" : allow,
-                               "acl" : acl];
+    if (id_item >= 0 && id_item < size(http_accesses)){
+        http_accesses[id_item] = $["allow" : allow,
+                                   "acl" : acl];
+    }
 }
+
 global void DelHttpAccess(integer id_item)
 {
-    http_accesses = remove(http_accesses, id_item);
+    if (id_item >= 0 && id_item < size(http_accesses)){
+        http_accesses = remove(http_accesses, id_item);
+    }
 }
+
 global void MoveHttpAccess(integer id_from, integer id_to)
 {
-    map<string,any> tmp = http_accesses[id_from]:$[];
-    http_accesses[id_from] = http_accesses[id_to]:$[];
-    http_accesses[id_to] = tmp;
+    if (id_from >= 0 && id_from < size(http_accesses)
+        && id_to >= 0 && id_to < size(http_accesses)){
+
+        map<string,any> tmp = http_accesses[id_from]:$[];
+        http_accesses[id_from] = http_accesses[id_to]:$[];
+        http_accesses[id_to] = tmp;
+    }
 }
 /******* HTTP_ACCESS END ******/
 
@@ -230,14 +367,17 @@
 {
     return settings;
 }
+
 global list<string> GetSetting(string name)
 {
     return settings[name]:[];
 }
+
 global void SetSetting(string name, list value)
 {
     settings[name] = value;
 }
+
 /******* SETTINGS END *****/
 
 /**** REFRESH PATTERN ****/
@@ -245,10 +385,12 @@
 {
     return refresh_patterns;
 }
+
 global map<string,any> GetRefreshPattern(integer id_item)
 {
     return refresh_patterns[id_item]:$[];
 }
+
 global void AddRefreshPattern(string regexp, string min, string percent, string max, boolean case_sensitive)
 {
     refresh_patterns = add(refresh_patterns, $[ "regexp" : regexp,
@@ -257,23 +399,34 @@
                                                 "max" : max,
                                                 "case_sensitive" : case_sensitive]);
 }
+
 global void ModifyRefreshPattern(integer id_item, string regexp, string min, string percent, string max, boolean case_sensitive)
 {
-    refresh_patterns[id_item] = $[ "regexp" : regexp,
-                                   "min" : min,
-                                   "percent" : percent,
-                                   "max" : max,
-                                   "case_sensitive" : case_sensitive];
+    if (id_item >= 0 && id_item < size(refresh_patterns)){
+        refresh_patterns[id_item] = $[ "regexp" : regexp,
+                                       "min" : min,
+                                       "percent" : percent,
+                                       "max" : max,
+                                       "case_sensitive" : case_sensitive];
+    }
 }
+
 global void DelRefreshPattern(integer id_item)
 {
-    refresh_patterns = remove(refresh_patterns, id_item);
+    if (id_item >= 0 && id_item < size(refresh_patterns)){
+        refresh_patterns = remove(refresh_patterns, id_item);
+    }
 }
+
 global void MoveRefreshPattern(integer id_from, integer id_to)
 {
-    map<string,any> tmp = refresh_patterns[id_from]:$[];
-    refresh_patterns[id_from] = refresh_patterns[id_to]:$[];
-    refresh_patterns[id_to] = tmp;
+    if (id_from >= 0 && id_from < size(refresh_patterns)
+        && id_to >= 0 && id_to < size(refresh_patterns)){
+
+        map<string,any> tmp = refresh_patterns[id_from]:$[];
+        refresh_patterns[id_from] = refresh_patterns[id_to]:$[];
+        refresh_patterns[id_to] = tmp;
+    }
 }
 /**** REFRESH PATTERN END ****/
 
@@ -282,39 +435,36 @@
 {
     return http_ports;
 }
+
 global map<string, any > GetHttpPort(integer id_item)
 {
     return http_ports[id_item]:$[];
 }
+
 global void AddHttpPort(string host, string port, boolean transparent)
 {
     http_ports = add(http_ports, $["host" : host,
                                    "port" : port,
                                    "transparent" : transparent]);
 }
+
 global void ModifyHttpPort(integer id_item, string host, string port, boolean transparent)
 {
-    http_ports[id_item] = $["host" : host,
-                            "port" : port,
-                            "transparent" : transparent];
+    if (id_item >= 0 && id_item < size(http_ports)){
+        http_ports[id_item] = $["host" : host,
+                                "port" : port,
+                                "transparent" : transparent];
+    }
 }
+
 global void DelHttpPort(integer id_item)
 {
-    http_ports = remove(http_ports, id_item);
+    if (id_item >= 0 && id_item < size(http_ports)){
+        http_ports = remove(http_ports, id_item);
+    }
 }
 /**** HTTP PORT END *****/
 
-/**
- * Same as splitstring(), but returns only non-empty strings.
- */
-list<string> split(string str, string delim)
-{
-    return filter(string value, splitstring(str, delim),
-                {
-                    //y2debug("Squid::split value: %1, size(value): %2",value, size(value));
-                    return (size(value)>0);
-                });
-}
 
 /**
  * Read setting of parameter http_port.
@@ -504,6 +654,23 @@
     return ok;
 }
 
+string repair_timeout_period_units(string old)
+{
+    string ret = "seconds";
+    if (old == "day"){
+        ret = "days";
+    }else if (old == "hour"){
+        ret = "hours";
+    }else if (old == "minute"){
+        ret = "minutes";
+    }else if (old == "second"){
+        ret = "seconds";
+    }else if (contains(["seconds", "minutes", "hours", "days"], old)){
+        ret = old;
+    }
+
+    return ret;
+}
 /**
  * Read rest of setting.
  * return true on success
@@ -530,6 +697,10 @@
     //special modification
     settings["cache_replacement_policy"] = [mergestring(settings["cache_replacement_policy"]:[]," ")];
     settings["memory_replacement_policy"] = [mergestring(settings["memory_replacement_policy"]:[]," ")];
+    settings["connect_timeout"] = [ (settings["connect_timeout"]:[])[0]:"",
+                                    repair_timeout_period_units((settings["connect_timeout"]:[])[1]:"") ];
+    settings["client_lifetime"] = [ (settings["client_lifetime"]:[])[0]:"",
+                                    repair_timeout_period_units((settings["client_lifetime"]:[])[1]:"") ];
 
     return ok;
 }

Modified: trunk/squid/src/SquidACL.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/SquidACL.ycp?rev=40016&r1=40015&r2=40016&view=diff
==============================================================================
--- trunk/squid/src/SquidACL.ycp (original)
+++ trunk/squid/src/SquidACL.ycp Mon Aug  6 16:41:54 2007
@@ -19,7 +19,7 @@
  */
 
 /**
- * File:       include/squid/acl.ycp
+ * File:       modules/SquidACL.ycp
  * Package:    Configuration of squid
  * Summary:    Definition and handling of ACL groups in Squid configuration
  * Authors:    Daniel Fiser <dfiser@xxxxxxx>
@@ -86,7 +86,8 @@
                           ),
                "widget_init" : srcWidgetInit,
                "verification" : srcVerif,
-               "options" : srcOptions ],
+               "options" : srcOptions,
+               "help" : "This is very usefull help text." ],
 
     "dst" : $[ "name" : "dst",
                "widget" : `Frame( _("dst"),
@@ -286,8 +287,11 @@
  * If id_item is not nil, function initialize widgets by default values
  * from module Squid.
  */
-global void InitWidget(string id_acl_type, integer id_item)
+global void InitWidget(string id_acl_type, integer id_item, any help_widget_id)
 {
+    if (help_widget_id != nil){
+        UI::ChangeWidget(`id(help_widget_id), `Value, (acl_map[id_acl_type]:$[])["help"]:"");
+    }
     void(integer) func = (void(integer))(acl_map[id_acl_type]:$[])["widget_init"]:nil;
     func(id_item);
 }

Modified: trunk/squid/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/complex.ycp?rev=40016&r1=40015&r2=40016&view=diff
==============================================================================
--- trunk/squid/src/complex.ycp (original)
+++ trunk/squid/src/complex.ycp Mon Aug  6 16:41:54 2007
@@ -197,8 +197,6 @@
         "memory_replacement_policy" : (set["memory_replacement_policy"]:[])[0]:"",
         "cache_dir" : (set["cache_dir"]:[])[1]:""
     ]);
-
-
 }
 void InitCacheDirAdvancedSettingDialog()
 {
@@ -308,6 +306,31 @@
         UI::ChangeWidget(`id("type"), `Value, acl["type"]:"");
     }
 }
+
+
+void InitLoggingFrame()
+{
+    map<string, list> set = (map<string, list>)Squid::GetSettings();
+    simpleInit($[
+        "access_log" : (set["access_log"]:[])[0]:"",
+        "cache_log" : (set["cache_log"]:[])[0]:"",
+        "cache_store_log" : (set["cache_store_log"]:[])[0]:"",
+        "cache_swap_log" : (set["cache_swap_log"]:[])[0]:"",
+
+        "emulate_httpd_log" : ((set["emulate_httpd_log"]:[])[0]:"" == "on" ? true : false)
+    ]);
+}
+
+void InitTimeoutsFrame()
+{
+    map<string, list> set = (map<string, list>)Squid::GetSettings();
+    simpleInit($[
+        "connect_timeout" : tointeger((set["connect_timeout"]:[])[0]:""),
+        "connect_timeout_units" : (set["connect_timeout"]:[])[1]:"",
+        "client_lifetime" : tointeger((set["client_lifetime"]:[])[0]:""),
+        "client_lifetime_units" : (set["client_lifetime"]:[])[1]:""
+    ]);
+}
 /*********************   INITS END  ****************/
 
 
@@ -515,7 +538,26 @@
         if (id_item == nil){
             Squid::AddACL(name, type, options);
         }else{
-            Squid::ModifyACL(id_item, name, type, options);
+            string old_name = (Squid::GetACL(id_item))["name"]:"";
+            if (old_name != name && Squid::NumACLs(id_item) == 1){
+                list<string> affected_options = Squid::ACLIsUsedBy(id_item);
+                if (size(affected_options) > 0 && contains(affected_options, "http_access")){
+                    Report::Error( _("You can not change name of this ACL Group, because \nit's used in Access Control table."));
+                    ok = false;
+                }else if (size(affected_options) > 0){
+                    if (!Report::AnyQuestion(Label::WarningMsg(),
+                                             _("If you change name of this ACL Group these options might be affected: \n")
+                                             + "    " + mergestring(affected_options, ",\n    ") + ".\n",
+                                             _("Change name anyway"),
+                                             _("Do not change name"),
+                                             `focus_no)){
+                        ok = false;
+                    }
+                }
+            }
+            if (ok){
+                Squid::ModifyACL(id_item, name, type, options);
+            }
         }
     }else if(verification){ // -> size(name) <= 0
         ok = false;
@@ -526,14 +568,58 @@
 
     return ok;
 }
+
+/**
+ * Delete ACL with id id_item.
+ * If ACL has only one occurence (one definition line) in config file and
+ * ACL is used by any option (http_access, no_cache ...) than user is asked
+ * if he really want to delete the ACL. If option 'http_access' uses this ACL
+ * than it's declined to delete the ACL.
+ */
 integer DelFromACLGroupsTable(integer id_item)
 {
-    Squid::DelACL(id_item);
-    if (id_item >= size(Squid::GetACLs())){
-        id_item = id_item - 1;
+    boolean ok = true;
+
+    if (Squid::NumACLs(id_item) == 1){
+        list<string> affected_options = Squid::ACLIsUsedBy(id_item);
+        if (size(affected_options) > 0){
+            ok = false;
+
+            if (contains(affected_options, "http_access")){
+                //Report::Error( _("This ACL Group can't be deleted.\nIt's used in Access Control table."));
+                Report::Error( _("You can not delete this ACL Group, because \nit's used in Access Control table."));
+            }else{
+                string message = _("If you delete this ACL Group these options might be affected: \n")
+                                 + "    " + mergestring(affected_options, ",\n    ") + ".\n";// +
+                                 //_("Are you sure you want to delete this ACL Group?");
+                if (Report::AnyQuestion(Label::WarningMsg(),
+                                        message,
+                                        _("Delete anyway"), //Label::YesButton(),
+                                        _("Do not delete"), //Label::NoButton(),
+                                        `focus_no)){
+                    ok = true;
+                }
+            }
+        }
+    }
+
+    if (ok){
+        Squid::DelACL(id_item);
+        if (id_item >= size(Squid::GetACLs())){
+            id_item = id_item - 1;
+        }
     }
+
     return id_item;
 }
+
+
+
+
+boolean StoreDataFromLoggingFrame()
+{
+    return true;
+}
 /********************* STORING + DELETING END ********************/
 
 }

Modified: trunk/squid/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/dialogs.ycp?rev=40016&r1=40015&r2=40016&view=diff
==============================================================================
--- trunk/squid/src/dialogs.ycp (original)
+++ trunk/squid/src/dialogs.ycp Mon Aug  6 16:41:54 2007
@@ -377,12 +377,12 @@
             `Left(`Frame(_("Timeouts"),
                 `VBox(
                     `HBox(
-                       `HSquash(`IntField(`id("connect_timeout"), _("Connection timeout"), 1, 99999, 10)),
-                       timeUnitWidget("connection_timeout_units")
+                       `IntField(`id("connect_timeout"), _("Connection timeout"), 0, 99999, 0),
+                       timeUnitWidget("connect_timeout_units")
                     ),
                     `HBox(
-                       `HSquash(`IntField(`id("client_lifetime"), _("Client Lifetime"), 1, 99999, 10)),
-                       timeUnitWidget("clien_lifetime_units")
+                       `IntField(`id("client_lifetime"), _("Client Lifetime"), 0, 99999, 0),
+                       timeUnitWidget("client_lifetime_units")
                     )
                 )
             ))
@@ -391,13 +391,18 @@
     Wizard::SetContentsButtons("Squid - Logging + Timeouts Setting", dialog_contents, "help",
         Label::BackButton(), Label::NextButton());
 
+    InitLoggingFrame();
+    InitTimeoutsFrame();
+
     while (true){
         ret = UI::UserInput();
 
         y2debug("BaseDialog(): ret == %1",ret);
 
-        if (ret == `next || ret == `back) break;
-        else if (ret == `abort || ret == `cancel){
+        if (ret == `next || ret == `back){
+            if(StoreDataFromLoggingFrame())
+                break;
+        }else if (ret == `abort || ret == `cancel){
             //if (Popup::ReallyAbort(true)) break;
             break;
             continue;

Modified: trunk/squid/src/popup_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/popup_dialogs.ycp?rev=40016&r1=40015&r2=40016&view=diff
==============================================================================
--- trunk/squid/src/popup_dialogs.ycp (original)
+++ trunk/squid/src/popup_dialogs.ycp Mon Aug  6 16:41:54 2007
@@ -307,7 +307,7 @@
                                    : _("Edit ACL Group"));
     term contents =
     `HBox(
-        `HWeight(50, `RichText(`id("help_text"), "Bla bla bla bla bla bla bla bla bla bla bla bla bla bla etc.")),
+        `HWeight(50, `RichText(`id("help_text"), "")),
         `HWeight(70, `VBox(
             `Label(label),
             `VSpacing(0.5),
@@ -331,7 +331,7 @@
 
     orig_type = (string)UI::QueryWidget(`id("type"), `Value);
     SquidACL::Replace(`replace_point, orig_type);
-    SquidACL::InitWidget(orig_type, id_item);
+    SquidACL::InitWidget(orig_type, id_item, "help_text");
 
     while (true){
         ui = UI::UserInput();
@@ -348,9 +348,9 @@
             type = (string)UI::QueryWidget(`id("type"), `Value);
             SquidACL::Replace(`replace_point, type);
             if (type == orig_type){
-                SquidACL::InitWidget(type, id_item);
+                SquidACL::InitWidget(type, id_item, "help_text");
             }else{
-                SquidACL::InitWidget(type, nil);
+                SquidACL::InitWidget(type, nil, "help_text");
             }
         }
     }

Copied: trunk/squid/testsuite/tests/Squid-Read.out (from r39866, trunk/squid/testsuite/tests/SquidRead.out)
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/Squid-Read.out?p2=trunk/squid/testsuite/tests/Squid-Read.out&p1=trunk/squid/testsuite/tests/SquidRead.out&r1=39866&r2=40016&rev=40016&view=diff
==============================================================================
--- trunk/squid/testsuite/tests/SquidRead.out (original)
+++ trunk/squid/testsuite/tests/Squid-Read.out Mon Aug  6 16:41:54 2007
@@ -20,7 +20,7 @@
 Read   .squid."acl" ["QUERY urlpath_regex cgi-bin \\?", "apache rep_header Server ^Apache", "all src 0.0.0.0/0.0.0.0", "manager proto cache_object", "localhost src  \t  \t 127.0.0.1/255.255.255.255", "localhost_public src 10.20.1.241/255.255.255.255", "to_localhost dst 127.0.0.0/8", "SSL_ports port  443", "Safe_ports port 80", "Safe_ports port 21", "Safe_ports port    443", "Safe_ports port 70", "Safe_ports port 210", "Safe_ports port 1025-65535", "Safe_ports port 280", "Safe_ports port 488", "Safe_ports port 591", "Safe_ports port 777", "CONNECT method CONNECT"]
 Return true
 Dump   Squid::acls
-Return [$["name":"QUERY", "options":["cgi-bin", "\\?"], "type":"urlpath_regex"], $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"], $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"], $["name":"manager", "options":["cache_object"], "type":"proto"], $["name":"localhost", "options":["127.0.0.1/255.255.255.255"], "type":"src"], $["name":"localhost_public", "options":["10.20.1.241/255.255.255.255"], "type":"src"], $["name":"to_localhost", "options":["127.0.0.0/8"], "type":"dst"], $["name":"SSL_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["80"], "type":"port"], $["name":"Safe_ports", "options":["21"], "type":"port"], $["name":"Safe_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["70"], "type":"port"], $["name":"Safe_ports", "options":["210"], "type":"port"], $["name":"Safe_ports", "options":["1025-65535"], "type":"port"], $["name":"Safe_ports", "options":["280"], "type":"port"], $["name":"Safe_ports", "options":["488"], "type":"port"], $["name":"Safe_ports", "options":["591"], "type":"port"], $["name":"Safe_ports", "options":["777"], "type":"port"], $["name":"CONNECT", "options":["CONNECT"], "type":"method"]]
+Return [$["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"], $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"], $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"], $["name":"manager", "options":["cache_object"], "type":"proto"], $["name":"localhost", "options":["127.0.0.1/255.255.255.255"], "type":"src"], $["name":"localhost_public", "options":["10.20.1.241/255.255.255.255"], "type":"src"], $["name":"to_localhost", "options":["127.0.0.0/8"], "type":"dst"], $["name":"SSL_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["80"], "type":"port"], $["name":"Safe_ports", "options":["21"], "type":"port"], $["name":"Safe_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["70"], "type":"port"], $["name":"Safe_ports", "options":["210"], "type":"port"], $["name":"Safe_ports", "options":["1025-65535"], "type":"port"], $["name":"Safe_ports", "options":["280"], "type":"port"], $["name":"Safe_ports", "options":["488"], "type":"port"], $["name":"Safe_ports", "options":["591"], "type":"port"], $["name":"Safe_ports", "options":["777"], "type":"port"], $["name":"CONNECT", "options":["CONNECT"], "type":"method"]]
 Dump   ------------------------------
 Dump   Squid::readRestSetting()
 Read   .squid."access_log" ["/var/log/squid/access.log"]
@@ -43,7 +43,7 @@
 Read   .squid."minimum_object_size" ["0 KB"]
 Return true
 Dump   Squid::settings
-Return $["access_log":["/var/log/squid/access.log"], "cache_dir":["ufs", "/var/cache/squid", "100", "16", "256"], "cache_log":["/var/log/squid/cache.log"], "cache_mem":["80", "MB"], "cache_mgr":["webmaster"], "cache_replacement_policy":["lru"], "cache_store_log":["/var/log/squid/store.log"], "cache_swap_high":["95"], "cache_swap_log":["none"], "cache_swap_low":["90"], "client_lifetime":["1", "day"], "connect_timeout":["2", "minutes"], "emulate_httpd_log":["off"], "error_directory":["/usr/share/squid/errors/English"], "ftp_passive":["on"], "maximum_object_size":["4096", "KB"], "memory_replacement_policy":["heap GDSF"], "minimum_object_size":["0", "KB"]]
+Return $["access_log":["/var/log/squid/access.log"], "cache_dir":["ufs", "/var/cache/squid", "100", "16", "256"], "cache_log":["/var/log/squid/cache.log"], "cache_mem":["80", "MB"], "cache_mgr":["webmaster"], "cache_replacement_policy":["lru"], "cache_store_log":["/var/log/squid/store.log"], "cache_swap_high":["95"], "cache_swap_log":["none"], "cache_swap_low":["90"], "client_lifetime":["1", "days"], "connect_timeout":["2", "minutes"], "emulate_httpd_log":["off"], "error_directory":["/usr/share/squid/errors/English"], "ftp_passive":["on"], "maximum_object_size":["4096", "KB"], "memory_replacement_policy":["heap GDSF"], "minimum_object_size":["0", "KB"]]
 Dump   ------------------------------
 Dump   Squid::Read()
 Read   .squid."http_port" ["localhost:3128", "80 transparent"]
@@ -70,9 +70,9 @@
 Read   .squid."minimum_object_size" ["0 KB"]
 Return true
 Dump   Squid::settings
-Return $["access_log":["/var/log/squid/access.log"], "cache_dir":["ufs", "/var/cache/squid", "100", "16", "256"], "cache_log":["/var/log/squid/cache.log"], "cache_mem":["80", "MB"], "cache_mgr":["webmaster"], "cache_replacement_policy":["lru"], "cache_store_log":["/var/log/squid/store.log"], "cache_swap_high":["95"], "cache_swap_log":["none"], "cache_swap_low":["90"], "client_lifetime":["1", "day"], "connect_timeout":["2", "minutes"], "emulate_httpd_log":["off"], "error_directory":["/usr/share/squid/errors/English"], "ftp_passive":["on"], "maximum_object_size":["4096", "KB"], "memory_replacement_policy":["heap GDSF"], "minimum_object_size":["0", "KB"]]
+Return $["access_log":["/var/log/squid/access.log"], "cache_dir":["ufs", "/var/cache/squid", "100", "16", "256"], "cache_log":["/var/log/squid/cache.log"], "cache_mem":["80", "MB"], "cache_mgr":["webmaster"], "cache_replacement_policy":["lru"], "cache_store_log":["/var/log/squid/store.log"], "cache_swap_high":["95"], "cache_swap_log":["none"], "cache_swap_low":["90"], "client_lifetime":["1", "days"], "connect_timeout":["2", "minutes"], "emulate_httpd_log":["off"], "error_directory":["/usr/share/squid/errors/English"], "ftp_passive":["on"], "maximum_object_size":["4096", "KB"], "memory_replacement_policy":["heap GDSF"], "minimum_object_size":["0", "KB"]]
 Dump   Squid::acls
-Return [$["name":"QUERY", "options":["cgi-bin", "\\?"], "type":"urlpath_regex"], $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"], $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"], $["name":"manager", "options":["cache_object"], "type":"proto"], $["name":"localhost", "options":["127.0.0.1/255.255.255.255"], "type":"src"], $["name":"localhost_public", "options":["10.20.1.241/255.255.255.255"], "type":"src"], $["name":"to_localhost", "options":["127.0.0.0/8"], "type":"dst"], $["name":"SSL_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["80"], "type":"port"], $["name":"Safe_ports", "options":["21"], "type":"port"], $["name":"Safe_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["70"], "type":"port"], $["name":"Safe_ports", "options":["210"], "type":"port"], $["name":"Safe_ports", "options":["1025-65535"], "type":"port"], $["name":"Safe_ports", "options":["280"], "type":"port"], $["name":"Safe_ports", "options":["488"], "type":"port"], $["name":"Safe_ports", "options":["591"], "type":"port"], $["name":"Safe_ports", "options":["777"], "type":"port"], $["name":"CONNECT", "options":["CONNECT"], "type":"method"]]
+Return [$["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"], $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"], $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"], $["name":"manager", "options":["cache_object"], "type":"proto"], $["name":"localhost", "options":["127.0.0.1/255.255.255.255"], "type":"src"], $["name":"localhost_public", "options":["10.20.1.241/255.255.255.255"], "type":"src"], $["name":"to_localhost", "options":["127.0.0.0/8"], "type":"dst"], $["name":"SSL_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["80"], "type":"port"], $["name":"Safe_ports", "options":["21"], "type":"port"], $["name":"Safe_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["70"], "type":"port"], $["name":"Safe_ports", "options":["210"], "type":"port"], $["name":"Safe_ports", "options":["1025-65535"], "type":"port"], $["name":"Safe_ports", "options":["280"], "type":"port"], $["name":"Safe_ports", "options":["488"], "type":"port"], $["name":"Safe_ports", "options":["591"], "type":"port"], $["name":"Safe_ports", "options":["777"], "type":"port"], $["name":"CONNECT", "options":["CONNECT"], "type":"method"]]
 Dump   Squid::refresh_patterns
 Return [$["case_sensitive":true, "max":"10080", "min":"1440", "percent":"20", "regexp":"^ftp:"], $["case_sensitive":false, "max":"1440", "min":"1440", "percent":"0", "regexp":"^gopher:"], $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]]
 Dump   Squid::http_accesses

Added: trunk/squid/testsuite/tests/Squid.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/Squid.err?rev=40016&view=auto
==============================================================================
    (empty)

Added: trunk/squid/testsuite/tests/Squid.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/Squid.out?rev=40016&view=auto
==============================================================================
--- trunk/squid/testsuite/tests/Squid.out (added)
+++ trunk/squid/testsuite/tests/Squid.out Mon Aug  6 16:41:54 2007
@@ -0,0 +1,224 @@
+Read   .squid."http_port" ["localhost:3128", "80 transparent"]
+Read   .squid."refresh_pattern" ["^ftp:\t\t1440\t20%\t10080", "-i ^gopher:\t1440\t0%\t1440", ".\t\t0\t20%\t4320"]
+Read   .squid."acl" ["QUERY urlpath_regex cgi-bin \\?", "apache rep_header Server ^Apache", "all src 0.0.0.0/0.0.0.0", "manager proto cache_object", "localhost src  \t  \t 127.0.0.1/255.255.255.255", "localhost_public src 10.20.1.241/255.255.255.255", "to_localhost dst 127.0.0.0/8", "SSL_ports port  443", "Safe_ports port 80", "Safe_ports port 21", "Safe_ports port    443", "Safe_ports port 70", "Safe_ports port 210", "Safe_ports port 1025-65535", "Safe_ports port 280", "Safe_ports port 488", "Safe_ports port 591", "Safe_ports port 777", "CONNECT method CONNECT"]
+Read   .squid."http_access" ["allow manager localhost", "deny manager", "deny !Safe_ports", "deny CONNECT  !SSL_ports", "allow localhost", "allow  localhost_public", "deny all"]
+Read   .squid."access_log" ["/var/log/squid/access.log"]
+Read   .squid."cache_dir" ["ufs /var/cache/squid 100 16 256"]
+Read   .squid."cache_log" ["/var/log/squid/cache.log"]
+Read   .squid."cache_mem" ["80 MB"]
+Read   .squid."cache_mgr" ["webmaster"]
+Read   .squid."cache_replacement_policy" ["lru"]
+Read   .squid."cache_store_log" ["/var/log/squid/store.log"]
+Read   .squid."cache_swap_high" ["95"]
+Read   .squid."cache_swap_log" ["none"]
+Read   .squid."cache_swap_low" ["90"]
+Read   .squid."client_lifetime" ["1 day"]
+Read   .squid."connect_timeout" ["2 minutes"]
+Read   .squid."emulate_httpd_log" ["off"]
+Read   .squid."error_directory" ["/usr/share/squid/errors/English"]
+Read   .squid."ftp_passive" ["on"]
+Read   .squid."maximum_object_size" ["4096 KB"]
+Read   .squid."memory_replacement_policy" ["heap GDSF"]
+Read   .squid."minimum_object_size" ["0 KB"]
+Dump   ==================================================
+Dump   =====================  ACL  ======================
+Dump   ==================================================
+Dump   
+Dump   GetACLs()
+Return [$["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"], $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"], $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"], $["name":"manager", "options":["cache_object"], "type":"proto"], $["name":"localhost", "options":["127.0.0.1/255.255.255.255"], "type":"src"], $["name":"localhost_public", "options":["10.20.1.241/255.255.255.255"], "type":"src"], $["name":"to_localhost", "options":["127.0.0.0/8"], "type":"dst"], $["name":"SSL_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["80"], "type":"port"], $["name":"Safe_ports", "options":["21"], "type":"port"], $["name":"Safe_ports", "options":["443"], "type":"port"], $["name":"Safe_ports", "options":["70"], "type":"port"], $["name":"Safe_ports", "options":["210"], "type":"port"], $["name":"Safe_ports", "options":["1025-65535"], "type":"port"], $["name":"Safe_ports", "options":["280"], "type":"port"], $["name":"Safe_ports", "options":["488"], "type":"port"], $["name":"Safe_ports", "options":["591"], "type":"port"], $["name":"Safe_ports", "options":["777"], "type":"port"], $["name":"CONNECT", "options":["CONNECT"], "type":"method"]]
+Dump   
+Dump   GetACL(0)
+Return $["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"]
+Dump   GetACL(2)
+Return $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"]
+Dump   GetACL(100) - out of range
+Return $[]
+Dump   ++++++++++++++++++++++++++++++++++++++++++++++++++
+Dump   
+Dump   AddACL("name", "type", ["list", "of", "options"])
+Return nil
+Return $["name":"name", "options":["list", "of", "options"], "type":"type"]
+Dump   
+Dump   ModifyACL(0, "QUERY2", "urlpath_regex", ["cgi-bin \? aaa"])
+Return $["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"]
+Return nil
+Return $["name":"QUERY2", "options":["cgi-bin \\? aaa"], "type":"urlpath_regex"]
+Return nil
+Dump   
+Dump   ModifyACL(100, "A", "a", ["a"]) - out of range
+Return $[]
+Return nil
+Return $[]
+Dump   
+Dump   DelACL(1)
+Return $["name":"apache", "options":["Server", "^Apache"], "type":"rep_header"]
+Return $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"]
+Return nil
+Return $["name":"all", "options":["0.0.0.0/0.0.0.0"], "type":"src"]
+Dump   
+Dump   DelACL(100) - out of range
+Return nil
+Return $[]
+Return $["name":"QUERY", "options":["cgi-bin \\?"], "type":"urlpath_regex"]
+Dump   ++++++++++++++++++++++++++++++++++++++++++++++++++
+Dump   
+Dump   NumACLs(0)
+Return 1
+Dump   NumACLs(10)
+Return 10
+Dump   
+Dump   ACLIsUsedBy(0) - QUERY
+Dir    .squid: ["access_log", "acl", "cache_dir", "cache_log", "cache_mem", "cache_mgr", "cache_replacement_policy", "cache_store_log", "cache_swap_high", "cache_swap_log", "cache_swap_low", "client_lifetime", "connect_timeout", "emulate_httpd_log", "error_directory", "ftp_passive", "http_access", "http_port", "maximum_object_size", "memory_replacement_policy", "minimum_object_size", "no_cache", "refresh_pattern"]
+Read   .squid."no_cache" ["deny QUERY"]
+Read   .squid."access_log" ["/var/log/squid/access.log"]
+Return ["no_cache"]
+Dump   ACLIsUsedBy(1)
+Dir    .squid: ["access_log", "acl", "cache_dir", "cache_log", "cache_mem", "cache_mgr", "cache_replacement_policy", "cache_store_log", "cache_swap_high", "cache_swap_log", "cache_swap_low", "client_lifetime", "connect_timeout", "emulate_httpd_log", "error_directory", "ftp_passive", "http_access", "http_port", "maximum_object_size", "memory_replacement_policy", "minimum_object_size", "no_cache", "refresh_pattern"]
+Read   .squid."no_cache" ["deny QUERY"]
+Read   .squid."access_log" ["/var/log/squid/access.log"]
+Return ["http_access"]
+Dump   ==================================================
+Dump   ================  HTTP_ACCESS  ===================
+Dump   ==================================================
+Dump   
+Dump   GetHttpAccesses()
+Return [$["acl":["manager", "localhost"], "allow":true], $["acl":["manager"], "allow":false], $["acl":["!Safe_ports"], "allow":false], $["acl":["CONNECT", "!SSL_ports"], "allow":false], $["acl":["localhost"], "allow":true], $["acl":["localhost_public"], "allow":true], $["acl":["all"], "allow":false]]
+Dump   
+Dump   GetHttpAccess(0)
+Return $["acl":["manager", "localhost"], "allow":true]
+Dump   GetHttpAccess(2)
+Return $["acl":["!Safe_ports"], "allow":false]
+Dump   GetHttpAccess(100) - out of range
+Return $[]
+Dump   ++++++++++++++++++++++++++++++++++++++++++++++++++
+Dump   
+Dump   AddHttpAccess(true, ["list", "of", "acls"])
+Return nil
+Return $["acl":["list", "of", "acls"], "allow":true]
+Dump   
+Dump   ModifyHttpAccess(0, false, ["manager", "locahost"])
+Return $["acl":["manager", "localhost"], "allow":true]
+Return nil
+Return $["acl":["manager", "localhost"], "allow":false]
+Return nil
+Dump   
+Dump   ModifyHttpAccess(100, true, ["a"]) - out of range
+Return $[]
+Return nil
+Return $[]
+Dump   
+Dump   DelHttpAccess(1)
+Return $["acl":["manager"], "allow":false]
+Return $["acl":["!Safe_ports"], "allow":false]
+Return nil
+Return $["acl":["!Safe_ports"], "allow":false]
+Dump   
+Dump   MoveHttpAccess(0,1)
+Return $["acl":["manager", "localhost"], "allow":true]
+Return $["acl":["!Safe_ports"], "allow":false]
+Return nil
+Return $["acl":["!Safe_ports"], "allow":false]
+Return $["acl":["manager", "localhost"], "allow":true]
+Dump   
+Dump   DelHttpAccess(100) - out of range
+Return nil
+Return $[]
+Return $["acl":["!Safe_ports"], "allow":false]
+Dump   ==================================================
+Dump   =================   SETTINGS  ====================
+Dump   ==================================================
+Dump   
+Dump   GetSettings()
+Return $["access_log":["/var/log/squid/access.log"], "cache_dir":["ufs", "/var/cache/squid", "100", "16", "256"], "cache_log":["/var/log/squid/cache.log"], "cache_mem":["80", "MB"], "cache_mgr":["webmaster"], "cache_replacement_policy":["lru"], "cache_store_log":["/var/log/squid/store.log"], "cache_swap_high":["95"], "cache_swap_log":["none"], "cache_swap_low":["90"], "client_lifetime":["1", "days"], "connect_timeout":["2", "minutes"], "emulate_httpd_log":["off"], "error_directory":["/usr/share/squid/errors/English"], "ftp_passive":["on"], "maximum_object_size":["4096", "KB"], "memory_replacement_policy":["heap GDSF"], "minimum_object_size":["0", "KB"]]
+Dump   
+Dump   GetSetting("cache_dir")
+Return ["ufs", "/var/cache/squid", "100", "16", "256"]
+Dump   
+Dump   SetSetting("cache_dir", ["uufs", "/var/", "10", "10", "10"])
+Return nil
+Return ["uufs", "/var/", "10", "10", "10"]
+Dump   ==================================================
+Dump   ==============  REFRESH_PATTERNS  ================
+Dump   ==================================================
+Dump   
+Dump   GetRefreshPatterns()
+Return [$["case_sensitive":true, "max":"10080", "min":"1440", "percent":"20", "regexp":"^ftp:"], $["case_sensitive":false, "max":"1440", "min":"1440", "percent":"0", "regexp":"^gopher:"], $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]]
+Dump   
+Dump   GetRefreshPattern(0)
+Return $["case_sensitive":true, "max":"10080", "min":"1440", "percent":"20", "regexp":"^ftp:"]
+Dump   GetRefreshPattern(2)
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Dump   GetRefreshPattern(100) - out of range
+Return $[]
+Dump   ++++++++++++++++++++++++++++++++++++++++++++++++++
+Dump   
+Dump   AddRefreshPattern("regexp", "100", "100", "100", false)
+Return nil
+Return $["case_sensitive":false, "max":"100", "min":"100", "percent":"100", "regexp":"regexp"]
+Dump   
+Dump   ModifyRefreshPattern(0, "regexp",  "100", "100", "100", false)
+Return $["case_sensitive":true, "max":"10080", "min":"1440", "percent":"20", "regexp":"^ftp:"]
+Return nil
+Return $["case_sensitive":false, "max":"100", "min":"100", "percent":"100", "regexp":"regexp"]
+Dump   
+Dump   ModifyRefreshPattern(100, "regexp",  "100", "100", "100", false)
+Return $[]
+Return nil
+Return $[]
+Dump   
+Dump   DelRefreshPattern(1)
+Return $["case_sensitive":false, "max":"1440", "min":"1440", "percent":"0", "regexp":"^gopher:"]
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Return nil
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Dump   
+Dump   MoveRefreshPattern(0,1)
+Return $["case_sensitive":false, "max":"100", "min":"100", "percent":"100", "regexp":"regexp"]
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Return nil
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Return $["case_sensitive":false, "max":"100", "min":"100", "percent":"100", "regexp":"regexp"]
+Dump   
+Dump   DelRefreshPattern(100) - out of range
+Return nil
+Return $[]
+Return $["case_sensitive":true, "max":"4320", "min":"0", "percent":"20", "regexp":"."]
+Dump   ==================================================
+Dump   =================  HTTP_PORT  ====================
+Dump   ==================================================
+Dump   
+Dump   GetHttpPorts()
+Return [$["host":"localhost", "port":"3128"], $["host":"", "port":"80", "transparent":true]]
+Dump   
+Dump   GetHttpPort(0)
+Return $["host":"localhost", "port":"3128"]
+Dump   GetHttpPort(2)
+Return $[]
+Dump   GetHttpPort(100) - out of range
+Return $[]
+Dump   ++++++++++++++++++++++++++++++++++++++++++++++++++
+Dump   
+Dump   AddHttpPort("host", "port", true)
+Return nil
+Return $["host":"host", "port":"port", "transparent":true]
+Dump   
+Dump   ModifyHttpPort(0, "host", "port", true)
+Return $["host":"localhost", "port":"3128"]
+Return nil
+Return $["host":"host", "port":"port", "transparent":true]
+Dump   
+Dump   ModifyHttpPort(100, "host", "port", true)
+Return $[]
+Return nil
+Return $[]
+Dump   
+Dump   DelHttpPort(1)
+Return $["host":"", "port":"80", "transparent":true]
+Return $["host":"host", "port":"port", "transparent":true]
+Return nil
+Return $["host":"host", "port":"port", "transparent":true]
+Dump   
+Dump   DelHttpPort(100) - out of range
+Return nil
+Return $[]
+Return $["host":"host", "port":"port", "transparent":true]

Added: trunk/squid/testsuite/tests/Squid.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/Squid.ycp?rev=40016&view=auto
==============================================================================
--- trunk/squid/testsuite/tests/Squid.ycp (added)
+++ trunk/squid/testsuite/tests/Squid.ycp Mon Aug  6 16:41:54 2007
@@ -0,0 +1,321 @@
+{
+// testedfiles: Squid.ycp
+
+include "testsuite.ycp";
+map READ = $[
+    "squid" : $[
+        "http_port" : ["localhost:3128", "80 transparent"],
+        "acl" : ["QUERY urlpath_regex cgi-bin \\?",
+                 "apache rep_header Server ^Apache",
+                 "all src 0.0.0.0/0.0.0.0",
+                 "manager proto cache_object",
+                 "localhost src  \t  \t 127.0.0.1/255.255.255.255",
+                 "localhost_public src 10.20.1.241/255.255.255.255",
+                 "to_localhost dst 127.0.0.0/8",
+                 "SSL_ports port  443",
+                 "Safe_ports port 80",
+                 "Safe_ports port 21",
+                 "Safe_ports port    443",
+                 "Safe_ports port 70",
+                 "Safe_ports port 210",
+                 "Safe_ports port 1025-65535",
+                 "Safe_ports port 280",
+                 "Safe_ports port 488",
+                 "Safe_ports port 591",
+                 "Safe_ports port 777",
+                 "CONNECT method CONNECT"],
+        "http_access" : ["allow manager localhost",
+                         "deny manager",
+                         "deny !Safe_ports",
+                         "deny CONNECT  !SSL_ports",
+                         "allow localhost",
+                         "allow  localhost_public",
+                         "deny all"],
+       "refresh_pattern" : ["^ftp:\t\t1440\t20%\t10080",
+                            "-i ^gopher:\t1440\t0%\t1440",
+                            ".\t\t0\t20%\t4320"],
+
+       "cache_dir" : ["ufs /var/cache/squid 100 16 256"],
+       "cache_mem" : ["80 MB"],
+       "cache_swap_low" : ["90"],
+       "cache_swap_high" : ["95"],
+       "maximum_object_size" : ["4096 KB"],
+       "minimum_object_size" : ["0 KB"],
+       "cache_replacement_policy" : ["lru"],
+       "memory_replacement_policy" : ["heap GDSF"],
+
+       "access_log" : ["/var/log/squid/access.log"],
+       "cache_log" : ["/var/log/squid/cache.log"],
+       "cache_store_log" : ["/var/log/squid/store.log"],
+       "cache_swap_log" : ["none"],
+       "emulate_httpd_log" : ["off"],
+
+       "connect_timeout" : ["2 minutes"],
+       "client_lifetime" : ["1 day"],
+
+       "error_directory" : ["/usr/share/squid/errors/English"],
+       "cache_mgr" : ["webmaster"],
+       "ftp_passive" : ["on"],
+
+       "no_cache" : ["deny QUERY"]
+    ]
+];
+
+map WRITE = $[];
+map EXECUTE = $[];
+
+import "Squid";
+TESTSUITE_INIT([READ,WRITE,EXECUTE], nil);
+
+Squid::Read();
+
+
+DUMP("==================================================");
+DUMP("=====================  ACL  ======================");
+DUMP("==================================================");
+
+DUMP("");
+DUMP("GetACLs()");
+TEST(``(Squid::GetACLs()), [], nil);
+
+DUMP("");
+DUMP("GetACL(0)");
+TEST(``(Squid::GetACL(0)), [], nil);
+DUMP("GetACL(2)");
+TEST(``(Squid::GetACL(2)), [], nil);
+DUMP("GetACL(100) - out of range");
+TEST(``(Squid::GetACL(100)), [], nil);
+
+DUMP("++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+DUMP("");
+DUMP("AddACL(\"name\", \"type\", [\"list\", \"of\", \"options\"])");
+TEST(``(Squid::AddACL("name", "type", ["list", "of", "options"])), [], nil);
+TEST(``(Squid::GetACL(size(Squid::GetACLs()) - 1)), [], nil);
+
+DUMP("");
+DUMP("ModifyACL(0, \"QUERY2\", \"urlpath_regex\", [\"cgi-bin \\? aaa\"])");
+TEST(``(Squid::GetACL(0)), [], nil);
+TEST(``(Squid::ModifyACL(0, "QUERY2", "urlpath_regex", ["cgi-bin \\? aaa"])), [], nil);
+TEST(``(Squid::GetACL(0)), [], nil);
+TEST(``(Squid::ModifyACL(0, "QUERY", "urlpath_regex", ["cgi-bin \\?"])), [], nil);
+
+DUMP("");
+DUMP("ModifyACL(100, \"A\", \"a\", [\"a\"]) - out of range");
+TEST(``(Squid::GetACL(100)), [], nil);
+TEST(``(Squid::ModifyACL(100, "A", "a", ["a"])), [], nil);
+TEST(``(Squid::GetACL(100)), [], nil);
+
+DUMP("");
+DUMP("DelACL(1)");
+TEST(``(Squid::GetACL(1)), [], nil);
+TEST(``(Squid::GetACL(2)), [], nil);
+TEST(``(Squid::DelACL(1)), [], nil);
+TEST(``(Squid::GetACL(1)), [], nil);
+
+DUMP("");
+DUMP("DelACL(100) - out of range");
+TEST(``(Squid::DelACL(100)), [], nil);
+TEST(``(Squid::GetACL(100)), [], nil);
+TEST(``(Squid::GetACL(0)), [], nil);
+
+DUMP("++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+DUMP("");
+DUMP("NumACLs(0)");
+TEST(``(Squid::NumACLs(0)), [], nil);
+DUMP("NumACLs(10)");
+TEST(``(Squid::NumACLs(10)), [], nil);
+
+DUMP("");
+DUMP("ACLIsUsedBy(0) - QUERY");
+TEST(``(Squid::ACLIsUsedBy(0)), [READ, WRITE, EXECUTE], nil);
+DUMP("ACLIsUsedBy(1)");
+TEST(``(Squid::ACLIsUsedBy(1)), [READ, WRITE, EXECUTE], nil);
+
+
+
+DUMP("==================================================");
+DUMP("================  HTTP_ACCESS  ===================");
+DUMP("==================================================");
+
+DUMP("");
+DUMP("GetHttpAccesses()");
+TEST(``(Squid::GetHttpAccesses()), [], nil);
+
+DUMP("");
+DUMP("GetHttpAccess(0)");
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+DUMP("GetHttpAccess(2)");
+TEST(``(Squid::GetHttpAccess(2)), [], nil);
+DUMP("GetHttpAccess(100) - out of range");
+TEST(``(Squid::GetHttpAccess(100)), [], nil);
+
+DUMP("++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+DUMP("");
+DUMP("AddHttpAccess(true, [\"list\", \"of\", \"acls\"])");
+TEST(``(Squid::AddHttpAccess(true, ["list", "of", "acls"])), [], nil);
+TEST(``(Squid::GetHttpAccess(size(Squid::GetHttpAccesses()) - 1)), [], nil);
+
+DUMP("");
+DUMP("ModifyHttpAccess(0, false, [\"manager\", \"locahost\"])");
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+TEST(``(Squid::ModifyHttpAccess(0, false, ["manager", "localhost"])), [], nil);
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+TEST(``(Squid::ModifyHttpAccess(0, true, ["manager", "localhost"])), [], nil);
+
+DUMP("");
+DUMP("ModifyHttpAccess(100, true, [\"a\"]) - out of range");
+TEST(``(Squid::GetHttpAccess(100)), [], nil);
+TEST(``(Squid::ModifyHttpAccess(100, true, ["a"])), [], nil);
+TEST(``(Squid::GetHttpAccess(100)), [], nil);
+
+DUMP("");
+DUMP("DelHttpAccess(1)");
+TEST(``(Squid::GetHttpAccess(1)), [], nil);
+TEST(``(Squid::GetHttpAccess(2)), [], nil);
+TEST(``(Squid::DelHttpAccess(1)), [], nil);
+TEST(``(Squid::GetHttpAccess(1)), [], nil);
+
+DUMP("");
+DUMP("MoveHttpAccess(0,1)");
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+TEST(``(Squid::GetHttpAccess(1)), [], nil);
+TEST(``(Squid::MoveHttpAccess(0,1)), [], nil);
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+TEST(``(Squid::GetHttpAccess(1)), [], nil);
+
+DUMP("");
+DUMP("DelHttpAccess(100) - out of range");
+TEST(``(Squid::DelHttpAccess(100)), [], nil);
+TEST(``(Squid::GetHttpAccess(100)), [], nil);
+TEST(``(Squid::GetHttpAccess(0)), [], nil);
+
+
+
+DUMP("==================================================");
+DUMP("=================   SETTINGS  ====================");
+DUMP("==================================================");
+
+DUMP("");
+DUMP("GetSettings()");
+TEST(``(Squid::GetSettings()), [], nil);
+
+DUMP("");
+DUMP("GetSetting(\"cache_dir\")");
+TEST(``(Squid::GetSetting("cache_dir")), [], nil);
+
+DUMP("");
+DUMP("SetSetting(\"cache_dir\", [\"uufs\", \"/var/\", \"10\", \"10\", \"10\"])");
+TEST(``(Squid::SetSetting("cache_dir", ["uufs", "/var/", "10", "10", "10"])), [], nil);
+TEST(``(Squid::GetSetting("cache_dir")), [], nil);
+
+
+DUMP("==================================================");
+DUMP("==============  REFRESH_PATTERNS  ================");
+DUMP("==================================================");
+DUMP("");
+DUMP("GetRefreshPatterns()");
+TEST(``(Squid::GetRefreshPatterns()), [], nil);
+
+DUMP("");
+DUMP("GetRefreshPattern(0)");
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+DUMP("GetRefreshPattern(2)");
+TEST(``(Squid::GetRefreshPattern(2)), [], nil);
+DUMP("GetRefreshPattern(100) - out of range");
+TEST(``(Squid::GetRefreshPattern(100)), [], nil);
+
+DUMP("++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+DUMP("");
+DUMP("AddRefreshPattern(\"regexp\", \"100\", \"100\", \"100\", false)");
+TEST(``(Squid::AddRefreshPattern("regexp", "100", "100", "100", false)), [], nil);
+TEST(``(Squid::GetRefreshPattern(size(Squid::GetRefreshPatterns()) - 1)), [], nil);
+
+DUMP("");
+DUMP("ModifyRefreshPattern(0, \"regexp\",  \"100\", \"100\", \"100\", false)");
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+TEST(``(Squid::ModifyRefreshPattern(0, "regexp", "100", "100", "100", false)), [], nil);
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+
+DUMP("");
+DUMP("ModifyRefreshPattern(100, \"regexp\",  \"100\", \"100\", \"100\", false)");
+TEST(``(Squid::GetRefreshPattern(100)), [], nil);
+TEST(``(Squid::ModifyRefreshPattern(100,  "regexp", "100", "100", "100", false)), [], nil);
+TEST(``(Squid::GetRefreshPattern(100)), [], nil);
+
+DUMP("");
+DUMP("DelRefreshPattern(1)");
+TEST(``(Squid::GetRefreshPattern(1)), [], nil);
+TEST(``(Squid::GetRefreshPattern(2)), [], nil);
+TEST(``(Squid::DelRefreshPattern(1)), [], nil);
+TEST(``(Squid::GetRefreshPattern(1)), [], nil);
+
+DUMP("");
+DUMP("MoveRefreshPattern(0,1)");
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+TEST(``(Squid::GetRefreshPattern(1)), [], nil);
+TEST(``(Squid::MoveRefreshPattern(0,1)), [], nil);
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+TEST(``(Squid::GetRefreshPattern(1)), [], nil);
+
+
+DUMP("");
+DUMP("DelRefreshPattern(100) - out of range");
+TEST(``(Squid::DelRefreshPattern(100)), [], nil);
+TEST(``(Squid::GetRefreshPattern(100)), [], nil);
+TEST(``(Squid::GetRefreshPattern(0)), [], nil);
+
+
+DUMP("==================================================");
+DUMP("=================  HTTP_PORT  ====================");
+DUMP("==================================================");
+
+DUMP("");
+DUMP("GetHttpPorts()");
+TEST(``(Squid::GetHttpPorts()), [], nil);
+
+DUMP("");
+DUMP("GetHttpPort(0)");
+TEST(``(Squid::GetHttpPort(0)), [], nil);
+DUMP("GetHttpPort(2)");
+TEST(``(Squid::GetHttpPort(2)), [], nil);
+DUMP("GetHttpPort(100) - out of range");
+TEST(``(Squid::GetHttpPort(100)), [], nil);
+
+DUMP("++++++++++++++++++++++++++++++++++++++++++++++++++");
+
+DUMP("");
+DUMP("AddHttpPort(\"host\", \"port\", true)");
+TEST(``(Squid::AddHttpPort("host", "port", true)), [], nil);
+TEST(``(Squid::GetHttpPort(size(Squid::GetHttpPorts()) - 1)), [], nil);
+
+DUMP("");
+DUMP("ModifyHttpPort(0, \"host\", \"port\", true)");
+TEST(``(Squid::GetHttpPort(0)), [], nil);
+TEST(``(Squid::ModifyHttpPort(0, "host", "port", true)), [], nil);
+TEST(``(Squid::GetHttpPort(0)), [], nil);
+
+DUMP("");
+DUMP("ModifyHttpPort(100, \"host\", \"port\", true)");
+TEST(``(Squid::GetHttpPort(100)), [], nil);
+TEST(``(Squid::ModifyHttpPort(100, "host", "port", true)), [], nil);
+TEST(``(Squid::GetHttpPort(100)), [], nil);
+
+
+DUMP("");
+DUMP("DelHttpPort(1)");
+TEST(``(Squid::GetHttpPort(1)), [], nil);
+TEST(``(Squid::GetHttpPort(2)), [], nil);
+TEST(``(Squid::DelHttpPort(1)), [], nil);
+TEST(``(Squid::GetHttpPort(1)), [], nil);
+
+DUMP("");
+DUMP("DelHttpPort(100) - out of range");
+TEST(``(Squid::DelHttpPort(100)), [], nil);
+TEST(``(Squid::GetHttpPort(100)), [], nil);
+TEST(``(Squid::GetHttpPort(0)), [], nil);
+}
+/* vim: set sw=4 ts=4 et ft=ycp : */

Added: trunk/squid/testsuite/tests/SquidACL.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/SquidACL.err?rev=40016&view=auto
==============================================================================
    (empty)

Added: trunk/squid/testsuite/tests/SquidACL.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/SquidACL.out?rev=40016&view=auto
==============================================================================
--- trunk/squid/testsuite/tests/SquidACL.out (added)
+++ trunk/squid/testsuite/tests/SquidACL.out Mon Aug  6 16:41:54 2007
@@ -0,0 +1,4 @@
+Dump   SupportedACLs()
+Return ["arp", "browser", "dst", "dstdom_regex", "dstdomain", "maxconn", "method", "myip", "myport", "port", "proto", "referer_regex", "rep_header", "rep_mime_type", "req_header", "req_mime_type", "src", "srcdom_regex", "srcdomain", "time", "url_regex", "urlpath_regex"]
+Dump   GetTypesToComboBox()
+Return [`item (`id ("arp"), "arp"), `item (`id ("browser"), "browser"), `item (`id ("dst"), "dst"), `item (`id ("dstdom_regex"), "dstdom_regex"), `item (`id ("dstdomain"), "dstdomain"), `item (`id ("maxconn"), "maxconn"), `item (`id ("method"), "method"), `item (`id ("myip"), "myip"), `item (`id ("myport"), "myport"), `item (`id ("port"), "port"), `item (`id ("proto"), "proto"), `item (`id ("referer_regex"), "referer_regex"), `item (`id ("rep_header"), "rep_header"), `item (`id ("rep_mime_type"), "rep_mime_type"), `item (`id ("req_header"), "req_header"), `item (`id ("req_mime_type"), "req_mime_type"), `item (`id ("src"), "src"), `item (`id ("srcdom_regex"), "srcdom_regex"), `item (`id ("srcdomain"), "srcdomain"), `item (`id ("time"), "time"), `item (`id ("url_regex"), "url_regex"), `item (`id ("urlpath_regex"), "urlpath_regex")]

Added: trunk/squid/testsuite/tests/SquidACL.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/testsuite/tests/SquidACL.ycp?rev=40016&view=auto
==============================================================================
--- trunk/squid/testsuite/tests/SquidACL.ycp (added)
+++ trunk/squid/testsuite/tests/SquidACL.ycp Mon Aug  6 16:41:54 2007
@@ -0,0 +1,48 @@
+{
+// testedfiles: SquidACL.ycp
+map READ = $[
+    "squid" : $[
+        "acl" : ["QUERY urlpath_regex cgi-bin \\?",
+                 "apache rep_header Server ^Apache",
+                 "all src 0.0.0.0/0.0.0.0",
+                 "manager proto cache_object",
+                 "localhost src  \t  \t 127.0.0.1/255.255.255.255",
+                 "localhost_public src 10.20.1.241/255.255.255.255",
+                 "to_localhost dst 127.0.0.0/8",
+                 "SSL_ports port  443",
+                 "Safe_ports port 80",
+                 "Safe_ports port 21",
+                 "Safe_ports port    443",
+                 "Safe_ports port 70",
+                 "Safe_ports port 210",
+                 "Safe_ports port 1025-65535",
+                 "Safe_ports port 280",
+                 "Safe_ports port 488",
+                 "Safe_ports port 591",
+                 "Safe_ports port 777",
+                 "CONNECT method CONNECT"],
+        "http_access" : ["allow manager localhost",
+                         "deny manager",
+                         "deny !Safe_ports",
+                         "deny CONNECT  !SSL_ports",
+                         "allow localhost",
+                         "allow  localhost_public",
+                         "deny all"]
+    ]
+];
+
+map WRITE = $[];
+map EXECUTE = $[];
+
+include "testsuite.ycp";
+//TESTSUITE_INIT([READ,WRITE,EXECUTE], nil);
+
+import "SquidACL";
+
+DUMP("SupportedACLs()");
+TEST(``(SquidACL::SupportedACLs()), [], nil);
+DUMP("GetTypesToComboBox()");
+TEST(``(SquidACL::GetTypesToComboBox()), [], nil);
+
+}
+/* vim: set sw=4 ts=4 et ft=ycp : */

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages