[openstack-dev] [Horizon] how to add unmerged dependency to test-requirements

2013-07-31 Thread Kuang-Ching Wang
Hi, I am working on fwaas Horizon support, which requires fwaas CLI to work.  
Since fwaas CLI has not been merged (though it is functional), is there anyway 
I can specify the dependency in horizon/test-requirements file, such that 
Jenkins would be able to run for my horizon patch. 

Thanks!
KC
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [horizon] namespace error in unit test

2013-07-29 Thread Kuang-Ching Wang
I solved my own problem - I missed to enable my service in test/settings.py.

Thanks,
KC


On Jul 29, 2013, at 3:45 PM, Kuang-Ching Wang wrote:

> I got the following error in running unit test. 
> 
> ==
> ERROR: Failure: NoReverseMatch (u'firewalls' is not a registered namespace 
> inside 'horizon:project')
> --
> Traceback (most recent call last):
>  File 
> "/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/loader.py", 
> line 413, in loadTestsFromName
>addr.filename, addr.module)
>  File 
> "/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/importer.py",
>  line 47, in importFromPath
>return self.importFromDir(dir_path, fqname)
>  File 
> "/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/importer.py",
>  line 94, in importFromDir
>mod = load_module(part_fqname, fh, filename, desc)
>  File 
> "/home/nova/horizon/openstack_dashboard/dashboards/project/firewalls/tests.py",
>  line 42, in 
>class FirewallTests(test.TestCase):
>  File 
> "/home/nova/horizon/openstack_dashboard/dashboards/project/firewalls/tests.py",
>  line 51, in FirewallTests
>INDEX_URL = reverse('horizon:%s:firewalls:index' % DASHBOARD)
>  File 
> "/home/nova/horizon/.venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py",
>  line 489, in reverse
>(key, ':'.join(resolved_path)))
> NoReverseMatch: u'firewalls' is not a registered namespace inside 
> 'horizon:project'
> 
> 
> The urls.py syntax I used is consistent with other panels:
> 
> ….
> urlpatterns = patterns(
>'openstack_dashboard.dashboards.project.firewalls.views',
>url(r'^$', IndexView.as_view(), name='index'),
> ….
> 
> Any advice what's wrong?
> 
> Thanks!
> KC
> 



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [horizon] namespace error in unit test

2013-07-29 Thread Kuang-Ching Wang
I got the following error in running unit test. 

==
ERROR: Failure: NoReverseMatch (u'firewalls' is not a registered namespace 
inside 'horizon:project')
--
Traceback (most recent call last):
  File 
"/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/loader.py", 
line 413, in loadTestsFromName
addr.filename, addr.module)
  File 
"/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/importer.py", 
line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
  File 
"/home/nova/horizon/.venv/local/lib/python2.7/site-packages/nose/importer.py", 
line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
  File 
"/home/nova/horizon/openstack_dashboard/dashboards/project/firewalls/tests.py", 
line 42, in 
class FirewallTests(test.TestCase):
  File 
"/home/nova/horizon/openstack_dashboard/dashboards/project/firewalls/tests.py", 
line 51, in FirewallTests
INDEX_URL = reverse('horizon:%s:firewalls:index' % DASHBOARD)
  File 
"/home/nova/horizon/.venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py",
 line 489, in reverse
(key, ':'.join(resolved_path)))
NoReverseMatch: u'firewalls' is not a registered namespace inside 
'horizon:project'


The urls.py syntax I used is consistent with other panels:

….
urlpatterns = patterns(
'openstack_dashboard.dashboards.project.firewalls.views',
url(r'^$', IndexView.as_view(), name='index'),
….

Any advice what's wrong?

Thanks!
KC


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [OpenStack][python-quantumclient] unit test question

2013-06-27 Thread Kuang-Ching Wang
Ilya, thanks for digging this far!  Any advice on how to fix this issue?  

Thanks!
KC

On Jun 27, 2013, at 9:42 AM, Ilya Shakhat wrote:

> KC, it looks like I've found the cause, and it is related to the way how 
> firewall_rules_list is serialized/deserialized.
> 
> After fixing issue with plural form of firewall_policy 
> (quantum/v2_0/__init__.py line # 511), tox fails only with one error in 
> test_create_firewall_policy_with_all_params for xml format. The issue is that 
> mox doesn't get message body it is told to catch. The difference is visible 
> in test_cli20 #137 (MyComparator.equals):
>   expects:
>   {'firewall_policy': {'firewall_rules_list': ['rule_id1'], 'tenant_id': 
> 'my-tenant', 'name': 'my-name', 'admin_state_up': True}}
>   gets:
>   {'firewall_policy': {'firewall_rules_list': {'item': 'rule_id1'}, 
> 'tenant_id': 'my-tenant', 'name': 'my-name', 'admin_state_up': True}}
> 
> Ilya.
> 
> 2013/6/27 Kuang-Ching Wang 
> Ilya, thanks for catching this - I took care of the plural, though the POST 
> error earlier still persists.  
> 
> Any idea why the expected call breaks into two sections - the call itself and 
> the body separated?
> 
> KC
> 
> On Jun 26, 2013, at 1:18 PM, Ilya Shakhat wrote:
> 
>> Hi KC, 
>> 
>> There's one more place in code that relies on rule of making plurals, it 
>> adds letter 's' producing 'policys' instead of 'policies'. The code is in 
>> quantum/v2_0/__init__.py line # 511.
>> 
>> Thanks,
>> Ilya  
>> 
>> 2013/6/26 Kuang-Ching Wang 
>> Hi Eugene,
>> 
>> thanks for looking into this.  I just pushed my patch: 
>> https://review.openstack.org/#/c/33187/
>> 
>> Thanks!
>> KC
>> 
>> On Jun 25, 2013, at 9:08 PM, Eugene Nikanorov  
>> wrote:
>> 
>>> Hi,
>>> 
>>> Can you post the code if failing test?
>>> 
>>> Eugene.
>>> 
>>> 
>>> 
>>> On Wed, Jun 26, 2013 at 2:11 AM, Kuang-Ching Wang 
>>>  wrote:
>>> Hi,
>>> 
>>> I am seeing the following error and cannot figure out why it happened and 
>>> how to solve it.  Any advice would be appreciated.  Thanks!
>>> 
>>> UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
>>> - request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', 
>>> body='\n>> xmlns="http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-desc>>  
>>> quantum:type="bool">Truemy-tenantrule_id1>>  quantum:type="bool">True>> quantum:type="bool">Truemy-name', 
>>> headers={'X-Auth-Token': 'testtoken', 'Content-Type': 'application/xml', 
>>> 'Accept': 'application/xml', 'User-Agent': 'python-quantumclient'}) -> None
>>> + request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', 
>>> body=
>>> 
>>> + http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-tenantmy-desc>>  
>>> quantum:type="bool">Truerule_id1>>  quantum:type="bool">True>> quantum:type="bool">Truemy-name, 
>>> headers=) -> 
>>> (, '>> encoding=\'UTF-8\'?>\n>> xmlns="http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>myidmy-name')
>>> 
>>> KC
>>> 
>>> 
>>> ___
>>> OpenStack-dev mailing list
>>> OpenStack-dev@lists.openstack.org
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>> 
>>> ___
>>> OpenStack-dev mailing list
>>> OpenStack-dev@lists.openstack.org
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> 
>> 
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> 
>> 
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [OpenStack][python-quantumclient] unit test question

2013-06-26 Thread Kuang-Ching Wang
Ilya, thanks for catching this - I took care of the plural, though the POST 
error earlier still persists.  

Any idea why the expected call breaks into two sections - the call itself and 
the body separated?

KC

On Jun 26, 2013, at 1:18 PM, Ilya Shakhat wrote:

> Hi KC, 
> 
> There's one more place in code that relies on rule of making plurals, it adds 
> letter 's' producing 'policys' instead of 'policies'. The code is in 
> quantum/v2_0/__init__.py line # 511.
> 
> Thanks,
> Ilya  
> 
> 2013/6/26 Kuang-Ching Wang 
> Hi Eugene,
> 
> thanks for looking into this.  I just pushed my patch: 
> https://review.openstack.org/#/c/33187/
> 
> Thanks!
> KC
> 
> On Jun 25, 2013, at 9:08 PM, Eugene Nikanorov  wrote:
> 
>> Hi,
>> 
>> Can you post the code if failing test?
>> 
>> Eugene.
>> 
>> 
>> 
>> On Wed, Jun 26, 2013 at 2:11 AM, Kuang-Ching Wang 
>>  wrote:
>> Hi,
>> 
>> I am seeing the following error and cannot figure out why it happened and 
>> how to solve it.  Any advice would be appreciated.  Thanks!
>> 
>> UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
>> - request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', 
>> body='\n> xmlns="http://openstack.org/quantum/api/v2.0"; 
>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-desc>  
>> quantum:type="bool">Truemy-tenantrule_id1>  quantum:type="bool">True> quantum:type="bool">Truemy-name', 
>> headers={'X-Auth-Token': 'testtoken', 'Content-Type': 'application/xml', 
>> 'Accept': 'application/xml', 'User-Agent': 'python-quantumclient'}) -> None
>> + request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body=> version='1.0' encoding='UTF-8'?>
>> 
>> + http://openstack.org/quantum/api/v2.0"; 
>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-tenantmy-desc>  
>> quantum:type="bool">Truerule_id1>  quantum:type="bool">True> quantum:type="bool">Truemy-name, 
>> headers=) -> 
>> (, '> encoding=\'UTF-8\'?>\n> xmlns="http://openstack.org/quantum/api/v2.0"; 
>> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>myidmy-name')
>> 
>> KC
>> 
>> 
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> 
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [OpenStack][python-quantumclient] unit test question

2013-06-25 Thread Kuang-Ching Wang
Hi Eugene,

thanks for looking into this.  I just pushed my patch: 
https://review.openstack.org/#/c/33187/

Thanks!
KC

On Jun 25, 2013, at 9:08 PM, Eugene Nikanorov  wrote:

> Hi,
> 
> Can you post the code if failing test?
> 
> Eugene.
> 
> 
> 
> On Wed, Jun 26, 2013 at 2:11 AM, Kuang-Ching Wang  
> wrote:
> Hi,
> 
> I am seeing the following error and cannot figure out why it happened and how 
> to solve it.  Any advice would be appreciated.  Thanks!
> 
> UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
> - request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body=' version=\'1.0\' encoding=\'UTF-8\'?>\n xmlns="http://openstack.org/quantum/api/v2.0"; 
> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-desc  
> quantum:type="bool">Truemy-tenantrule_id1  quantum:type="bool">True quantum:type="bool">Truemy-name', 
> headers={'X-Auth-Token': 'testtoken', 'Content-Type': 'application/xml', 
> 'Accept': 'application/xml', 'User-Agent': 'python-quantumclient'}) -> None
> + request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body= version='1.0' encoding='UTF-8'?>
> 
> + http://openstack.org/quantum/api/v2.0"; 
> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-tenantmy-desc  
> quantum:type="bool">Truerule_id1  quantum:type="bool">True quantum:type="bool">Truemy-name, 
> headers=) -> 
> (, ' encoding=\'UTF-8\'?>\n xmlns="http://openstack.org/quantum/api/v2.0"; 
> xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>myidmy-name')
> 
> KC
> 
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [OpenStack][python-quantumclient] unit test question

2013-06-25 Thread Kuang-Ching Wang
Hi,

I am seeing the following error and cannot figure out why it happened and how 
to solve it.  Any advice would be appreciated.  Thanks!

UnexpectedMethodCallError: Unexpected method call.  unexpected:-  expected:+
- request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body='\nhttp://openstack.org/quantum/api/v2.0"; 
xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-descTruemy-tenantrule_id1TrueTruemy-name', 
headers={'X-Auth-Token': 'testtoken', 'Content-Type': 'application/xml', 
'Accept': 'application/xml', 'User-Agent': 'python-quantumclient'}) -> None
+ request.__call__('localurl/v2.0/firewall_policies.xml', 'POST', body=

+ http://openstack.org/quantum/api/v2.0"; 
xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>my-tenantmy-descTruerule_id1TrueTruemy-name, 
headers=) -> 
(, '\nhttp://openstack.org/quantum/api/v2.0"; 
xmlns:quantum="http://openstack.org/quantum/api/v2.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>myidmy-name')

KC


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [OpenStack][python-quantumclient] running tox in python-quantumclient

2013-06-23 Thread Kuang-Ching Wang
Hi,

I am trying to run a unit test for a module I am developing.  When I did the 
following, it showed commands passed, but in fact my test is not being run 
since even if I put random bogus file names or bugs in the test, it still shows 
passed.

under python-quantumclient/, I did the following. Note I intentionally placed a 
non-existent file name test_cli20_firewall_policys.py instead of the real name  
test_cli20_firewall_policy.py.

nova@nova:/opt/stack/python-quantumclient$ sudo tox -v -epy27 
tests.unit.test_cli20_firewall_policys.py
using tox.ini: /opt/stack/python-quantumclient/tox.ini
using tox-1.4.3 from /usr/local/lib/python2.7/dist-packages/tox/__init__.pyc
GLOB sdist-make: /opt/stack/python-quantumclient/setup.py
  /opt/stack/python-quantumclient$ /usr/bin/python 
/opt/stack/python-quantumclient/setup.py sdist --formats=zip --dist-dir 
/opt/stack/python-quantumclient/.tox/dist 
>/opt/stack/python-quantumclient/.tox/log/tox-0.log
py27 reusing: /opt/stack/python-quantumclient/.tox/py27
py27 inst-nodeps: 
/opt/stack/python-quantumclient/.tox/dist/python-quantumclient-2.2.2a.3.g4ebf9f2.zip
  /opt/stack/python-quantumclient/.tox/py27/log$ 
/opt/stack/python-quantumclient/.tox/py27/bin/pip install 
/opt/stack/python-quantumclient/.tox/dist/python-quantumclient-2.2.2a.3.g4ebf9f2.zip
 -U --no-deps >/opt/stack/python-quantumclient/.tox/py27/log/py27-20.log
py27 runtests: commands[0]
  /opt/stack/python-quantumclient$ 
/opt/stack/python-quantumclient/.tox/py27/bin/python setup.py testr 
--testr-args=tests.unit.test_cli20_firewall_policys.py 
running testr
running=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m 
subunit.run discover -t ./ ./tests --list 
PASSED (id=17)
_ summary 
__
  py27: commands succeeded
  congratulations :)



Thanks,
KC



___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev