Merge lp:~dobey/ubuntuone-dev-tools/ncsa-changed into lp:ubuntuone-dev-tools

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 107
Merged at revision: 106
Proposed branch: lp:~dobey/ubuntuone-dev-tools/ncsa-changed
Merge into: lp:ubuntuone-dev-tools
Diff against target: 102 lines (+19/-15)
4 files modified
data/squid.conf.in (+0/-4)
ubuntuone/devtools/services/squid.py (+12/-6)
ubuntuone/devtools/services/tests/test_squid_linux.py (+2/-2)
ubuntuone/devtools/services/tests/test_squid_windows.py (+5/-3)
To merge this branch: bzr merge lp:~dobey/ubuntuone-dev-tools/ncsa-changed
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+186438@code.launchpad.net

Commit message

Fixes to work with squid 3.3.8.

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) :
review: Approve
Revision history for this message
Mike McCracken (mikemc) wrote :

looks OK, I didn't test it on darwin (paths will be different) or windows (I don't have a working windows VM at the moment)

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (42.2 KiB)

The attempt to merge lp:~dobey/ubuntuone-dev-tools/ncsa-changed into lp:ubuntuone-dev-tools failed. Below is the output from the failed tests.

Starting squid version...
Waiting for squid to start....
Waiting for squid to start.....
Waiting for squid to start......
Waiting for squid to start.......
Waiting for squid to start........
Waiting for squid to start.........
Waiting for squid to start..........
Waiting for squid to start...........

Traceback (most recent call last):
  File "bin/u1trial", line 40, in <module>
    main()
  File "/mnt/tarmac/cache/ubuntuone-dev-tools/trunk/ubuntuone/devtools/runners/__init__.py", line 290, in main
    service.start_service(tempdir=test_runner.tempdir)
  File "/mnt/tarmac/cache/ubuntuone-dev-tools/trunk/ubuntuone/devtools/services/squid.py", line 309, in start_service
    raise SquidLaunchError(msg)
ubuntuone.devtools.services.squid.SquidLaunchError: Could not start squid:
stdout:

stderr
2013/09/18 23:38:50.566| debug.cc(424) parseOptions: command-line -X overrides: ALL,7
2013/09/18 23:38:50.566| cache_manager.cc(102) registerProfile: registering legacy mem
2013/09/18 23:38:50.566| cache_manager.cc(87) registerProfile: registered profile: mem
2013/09/18 23:38:50.566| cache_manager.cc(87) registerProfile: registered profile: diskd
2013/09/18 23:38:50.566| cache_manager.cc(102) registerProfile: registering legacy squidaio_counts
2013/09/18 23:38:50.566| cache_manager.cc(87) registerProfile: registered profile: squidaio_counts
2013/09/18 23:38:50.566| rock/RockStoreFileSystem.cc(44) setup: Will use Rock FS
2013/09/18 23:38:50.566| Startup: Initializing Authentication Schemes ...
2013/09/18 23:38:50.566| Startup: Initialized Authentication Scheme 'basic'
2013/09/18 23:38:50.566| Startup: Initialized Authentication Scheme 'digest'
2013/09/18 23:38:50.566| Startup: Initialized Authentication Scheme 'negotiate'
2013/09/18 23:38:50.566| Startup: Initialized Authentication Scheme 'ntlm'
2013/09/18 23:38:50.566| Startup: Initialized Authentication.
2013/09/18 23:38:50.566| tools.cc(69) ProbeTransport: Detected IPv6 hybrid or v4-mapping stack...
2013/09/18 23:38:50.566| tools.cc(83) ProbeTransport: IPv6 transport Enabled
2013/09/18 23:38:50.580| Config.cc(39) registerTokens: register format tokens for 'adapt'
2013/09/18 23:38:50.580| Config.cc(39) registerTokens: register format tokens for 'icap'
2013/09/18 23:38:50.580| cache_cf.cc(609) parseConfigFile:
2013/09/18 23:38:50.580| cf_parser.cci(3192) free_all:
2013/09/18 23:38:50.594| Gadgets.cc(245) aclDestroyAcls: aclDestroyACLs: invoked
2013/09/18 23:38:50.595| Acl.cc(400) Registered: ACL::Prototype::Registered: invoked for type src
2013/09/18 23:38:50.595| Acl.cc(404) Registered: ACL::Prototype::Registered: yes
2013/09/18 23:38:50.595| Acl.cc(61) FindByName: ACL::FindByName 'all'
2013/09/18 23:38:50.595| Acl.cc(67) FindByName: ACL::FindByName found no match
2013/09/18 23:38:50.595| Acl.cc(161) ParseAclLine: aclParseAclLine: Creating ACL 'all'
2013/09/18 23:38:50.595| Acl.cc(436) Factory: ACL::Prototype::Factory: cloning an object for type 'src'
2013/09/18 23:38:50.595| Ip.cc(260) FactoryParse: aclIpParseIpData: all
2013/09/18 23:38:50.595| Ip.cc(264) Fa...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/squid.conf.in'
2--- data/squid.conf.in 2012-04-24 17:58:16 +0000
3+++ data/squid.conf.in 2013-09-18 20:21:43 +0000
4@@ -2,7 +2,6 @@
5 # Use a default auth using ncsa and the passed generated file.
6 auth_param basic program ${auth_process} ${auth_file}
7 #Recommended minimum configuration:
8-acl manager proto cache_object
9 acl localhost src 127.0.0.1/32
10 acl to_localhost dst 127.0.0.0/32
11 #
12@@ -46,9 +45,6 @@
13
14 #Recommended minimum configuration:
15 #
16-# Only allow cachemgr access from localhost
17-http_access allow manager localhost
18-http_access deny manager
19 # Only allow purge requests from localhost
20 http_access allow purge localhost
21 http_access deny purge
22
23=== modified file 'ubuntuone/devtools/services/squid.py'
24--- ubuntuone/devtools/services/squid.py 2013-02-08 19:38:02 +0000
25+++ ubuntuone/devtools/services/squid.py 2013-09-18 20:21:43 +0000
26@@ -50,14 +50,15 @@
27 get_arbitrary_port,
28 )
29
30-# pylint: disable=C0103
31+NCSA_BASIC_PREFIX = 'basic_'
32 if sys.platform == 'win32':
33- AUTH_PROCESS_PATH = r'C:\squid\libexec\ncsa_auth.exe'
34+ AUTH_PROCESS_PATH = 'C:\\squid\\libexec\\'
35+ AUTH_PROCESS_NAME = 'ncsa_auth.exe'
36 SQUID_START_ARGS = ['-f']
37 else:
38- AUTH_PROCESS_PATH = '/usr/lib/%s/ncsa_auth'
39+ AUTH_PROCESS_PATH = '/usr/lib/%s/'
40+ AUTH_PROCESS_NAME = 'ncsa_auth'
41 SQUID_START_ARGS = ['-N', '-X', '-f']
42-# pylint: enable=C0103
43
44 SQUID_CONFIG_FILE = 'squid.conf.in'
45 SQUID_DIR = 'squid'
46@@ -77,11 +78,16 @@
47 if sys.platform == 'win32':
48 path = find_executable('ncsa_auth')
49 if path is None:
50- path = AUTH_PROCESS_PATH
51+ path = AUTH_PROCESS_PATH + NCSA_BASIC_PREFIX + AUTH_PROCESS_NAME
52+ if not exists(path):
53+ path = AUTH_PROCESS_PATH + AUTH_PROCESS_NAME
54 return format_config_path(path)
55 else:
56 squid = 'squid3' if squid_version == 3 else 'squid'
57- path = AUTH_PROCESS_PATH % squid
58+ auth_path = (AUTH_PROCESS_PATH % squid)
59+ path = auth_path + NCSA_BASIC_PREFIX + AUTH_PROCESS_NAME
60+ if not exists(path):
61+ path = auth_path + AUTH_PROCESS_NAME
62 return path
63
64
65
66=== modified file 'ubuntuone/devtools/services/tests/test_squid_linux.py'
67--- ubuntuone/devtools/services/tests/test_squid_linux.py 2012-04-26 14:52:43 +0000
68+++ ubuntuone/devtools/services/tests/test_squid_linux.py 2013-09-18 20:21:43 +0000
69@@ -40,12 +40,12 @@
70 def test_get_auth_process_3(self):
71 """Test getting the auth process for squid3."""
72 expected = squid.AUTH_PROCESS_PATH % 'squid3'
73- self.assertEqual(expected, squid.get_auth_process_path(3))
74+ self.assertTrue(squid.get_auth_process_path(3).startswith(expected))
75
76 def test_get_auth_process(self):
77 """Test getting the auth process."""
78 expected = squid.AUTH_PROCESS_PATH % 'squid'
79- self.assertEqual(expected, squid.get_auth_process_path(2))
80+ self.assertTrue(squid.get_auth_process_path(2).startswith(expected))
81
82 def test_format_config_path(self):
83 """Test formating a config path."""
84
85=== modified file 'ubuntuone/devtools/services/tests/test_squid_windows.py'
86--- ubuntuone/devtools/services/tests/test_squid_windows.py 2012-04-26 14:52:43 +0000
87+++ ubuntuone/devtools/services/tests/test_squid_windows.py 2013-09-18 20:21:43 +0000
88@@ -52,9 +52,11 @@
89 return path
90
91 self.patch(squid, 'format_config_path', fake_format)
92- self.assertEqual(squid.AUTH_PROCESS_PATH,
93- squid.get_auth_process_path(3))
94- self.assertIn(('format', squid.AUTH_PROCESS_PATH), called)
95+ self.assertTrue(squid.get_auth_process_path(3).startswith(
96+ squid.AUTH_PROCESS_PATH))
97+ self.assertIn(('format',
98+ squid.AUTH_PROCESS_PATH + squid.AUTH_PROCESS_NAME),
99+ called)
100
101 def test_get_auth_process_path(self):
102 """Test getting the auth process."""

Subscribers

People subscribed via source and target branches

to all changes: