Bug 35908

Summary: squid/redirect not usable on UCS
Product: UCS Test Reporter: Stefan Gohmann <gohmann>
Component: SquidAssignee: Ammar Najjar <najjar>
Status: CLOSED FIXED QA Contact: Felix Botner <botner>
Severity: normal    
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:
Bug Depends on: 32429    
Bug Blocks:    

Description Stefan Gohmann univentionstaff 2014-09-11 15:03:11 CEST
Please check if a test case is possible.

+++ This bug was initially created as a clone of Bug #32429 +++

Support for squid/redirect was merged from UCS@school in UCS 3.0-1. However, the template cannot be used in UCS out of the box. In UCS setting the variable will fail out of the box, since univention-squid doesn't depend on squidguard (in contrast to ucs@school):

if configRegistry.get("squid/redirect") == "squidguard":
        print 'url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf'

The template should rather use 

        print 'url_rewrite_program configRegistry['squid/redirect'

so that other redirectors can be used as well.
Comment 1 Ammar Najjar univentionstaff 2014-10-07 12:03:15 CEST
A new script is created with the name "43_proxy/01_squid_redirector_configuration" to test if the written configuration matches the current set ucr variable.

configRegistry.get("squid/redirect") == "squidguard" → 'url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf'
configRegistry.get("squid/redirect") == "x" → 'url_rewrite_program x'
configRegistry.get("squid/redirect") == None → '' (no url_rewrite_program line)

Tested for UCS-3.2 & UCS-4.0
Comment 2 Stefan Gohmann univentionstaff 2014-10-10 06:39:23 CEST
The test case failed in Jenkins:

Traceback (most recent call last):
  File "01_squid_redirector_configuration", line 38, in <module>
    main()
  File "01_squid_redirector_configuration", line 21, in main
    config_lines = get_lines_containing(SQUID_CONFIG, 'url_rewrite_program')
  File "01_squid_redirector_configuration", line 11, in get_lines_containing
    with open(filename) as input_file:
IOError: [Errno 2] No such file or directory: '/etc/squid3/squid.conf'

I think it should be checked if univention-squid is installed.
Comment 3 Ammar Najjar univentionstaff 2014-10-10 10:09:25 CEST
(In reply to Stefan Gohmann from comment #2)
> The test case failed in Jenkins:
> 
> Traceback (most recent call last):
>   File "01_squid_redirector_configuration", line 38, in <module>
>     main()
>   File "01_squid_redirector_configuration", line 21, in main
>     config_lines = get_lines_containing(SQUID_CONFIG, 'url_rewrite_program')
>   File "01_squid_redirector_configuration", line 11, in get_lines_containing
>     with open(filename) as input_file:
> IOError: [Errno 2] No such file or directory: '/etc/squid3/squid.conf'
> 
> I think it should be checked if univention-squid is installed.

Done.
Comment 4 Felix Botner univentionstaff 2015-02-03 13:45:25 CET
I can not see where squid/redirect is set.

We should check if squid/redirect=X results in "url_rewrite_program X" in /etc/squid3/squid.conf with the special case squid/redirect=squidguard (with "url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf" in squid.conf)

> "squid/redirect" is now simply the option for "url_rewrite_program" with the 
> special case "squid/redirect=squidguard", then 'url_rewrite_program /usr/bin
> /squidGuard -c /etc/squid/squidGuard.conf' is still used (so we don't break 
> ucs@school).
Comment 5 Ammar Najjar univentionstaff 2015-02-04 10:24:14 CET
(In reply to Felix Botner from comment #4)
> I can not see where squid/redirect is set.
> 
> We should check if squid/redirect=X results in "url_rewrite_program X" in
> /etc/squid3/squid.conf with the special case squid/redirect=squidguard (with
> "url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf" in
> squid.conf)
> 
> > "squid/redirect" is now simply the option for "url_rewrite_program" with the 
> > special case "squid/redirect=squidguard", then 'url_rewrite_program /usr/bin
> > /squidGuard -c /etc/squid/squidGuard.conf' is still used (so we don't break 
> > ucs@school).

Script modified to include the mentioned cases.
Changelog entry added, package rebuilt.
Comment 6 Felix Botner univentionstaff 2015-02-04 16:06:34 CET
OK