Commit 0cc3fc2b authored by Alex Pyrgiotis's avatar Alex Pyrgiotis
Browse files

admin: Fix copyrights

Also, cleanup unnecessary files.
parent 0e5d906a
Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
1. Redistributions of source code must retain the above
copyright notice, this list of conditions and the following
disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and
documentation are those of the authors and should not be
interpreted as representing official policies, either expressed
or implied, of GRNET S.A.
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
# Copyright (C) 2010-2014 GRNET S.A.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import distribute_setup
......
# Copyright 2014 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
import logging
# Copyright (C) 2010-2014 GRNET S.A.
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
import logging
import re
from collections import OrderedDict
......
# Copyright 2011-2014 GRNET S.A. All rights reserved.
# Copyright (C) 2010-2014 GRNET S.A.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
"""
Routers for the admin app. They are used to specify which database will be used
......
# Copyright 2012, 2013 GRNET S.A. All rights reserved.
# Copyright (C) 2010-2014 GRNET S.A.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of GRNET S.A.
from importlib import import_module
from collections import OrderedDict
......
# Copyright 2011, 2012, 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
#
import mock
from django.test import TestCase, Client
from django.conf import settings
from django.core.urlresolvers import reverse
from snf_django.utils.testing import mocked_quotaholder
USER1 = "5edcb5aa-1111-4146-a8ed-2b6287824353"
USER2 = "5edcb5aa-2222-4146-a8ed-2b6287824353"
USERS_UUIDS = {}
USERS_UUIDS[USER1] = {'displayname': 'testuser@test.com'}
USERS_UUIDS[USER2] = {'displayname': 'testuser2@test.com'}
USERS_DISPLAYNAMES = dict(map(lambda k: (k[1]['displayname'], {'uuid': k[0]}),
USERS_UUIDS.iteritems()))
from synnefo.db import models_factory as mfactory
class AstakosClientMock():
def __init__(*args, **kwargs):
pass
def get_username(self, uuid):
try:
return USERS_UUIDS.get(uuid)['displayname']
except TypeError:
return None
def get_uuid(self, display_name):
try:
return USERS_DISPLAYNAMES.get(display_name)['uuid']
except TypeError:
return None
class AuthClient(Client):
def request(self, **request):
token = request.pop('user_token', '0000')
if token:
request['HTTP_X_AUTH_TOKEN'] = token
return super(AuthClient, self).request(**request)
def get_user_mock(request, *args, **kwargs):
request.user_uniq = None
request.user = None
if request.META.get('HTTP_X_AUTH_TOKEN', None) == '0000':
request.user_uniq = 'test'
request.user = {"access": {
"token": {
"expires": "2013-06-19T15:23:59.975572+00:00",
"id": "0000",
"tenant": {
"id": "test",
"name": "Firstname Lastname"
}
},
"serviceCatalog": [],
"user": {
"roles_links": [],
"id": "test",
"roles": [{"id": 1, "name": "default"}],
"name": "Firstname Lastname"}}
}
if request.META.get('HTTP_X_AUTH_TOKEN', None) == '0001':
request.user_uniq = 'test'
request.user = {"access": {
"token": {
"expires": "2013-06-19T15:23:59.975572+00:00",
"id": "0001",
"tenant": {
"id": "test",
"name": "Firstname Lastname"
}
},
"serviceCatalog": [],
"user": {
"roles_links": [],
"id": "test",
"roles": [{"id": 1, "name": "default"},
{"id": 2, "name": "admin"}],
"name": "Firstname Lastname"}}
}
@mock.patch("astakosclient.AstakosClient", new=AstakosClientMock)
@mock.patch("snf_django.lib.astakos.get_user", new=get_user_mock)
class AdminTests(TestCase):
"""
Admin Interface tests. Test correctness of permissions and returned data.
"""
def setUp(self):
settings.SKIP_SSH_VALIDATION = True
settings.ADMIN_ENABLED = True
self.client = AuthClient()
# init models
vm1u1 = mfactory.VirtualMachineFactory(userid=USER1, name="user1 vm",
pk=1001)
vm1u2 = mfactory.VirtualMachineFactory(userid=USER2, name="user2 vm1",
pk=1002)
vm2u2 = mfactory.VirtualMachineFactory(userid=USER2, name="user2 vm2",
pk=1003)
nic1 = mfactory.NetworkInterfaceFactory(machine=vm1u2,
userid=vm1u2.userid,
network__public=False,
network__userid=USER1)
ip2 = mfactory.IPv4AddressFactory(nic__machine=vm1u1,
userid=vm1u1.userid,
network__public=True,
network__userid=None,
address="195.251.222.211")
mfactory.IPAddressLogFactory(address=ip2.address,
server_id=vm1u1.id,
network_id=ip2.network.id,
active=True)
def test_enabled_setting(self):
settings.ADMIN_ENABLED = False
# admin is disabled
r = self.client.get(reverse('admin-index'), user_token="0001")
self.assertEqual(r.status_code, 404)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
self.assertEqual(r.status_code, 404)
def test_ip_lookup(self):
# ip does not exist, proper message gets displayed
r = self.client.get(reverse('admin-details',
args=["195.251.221.122"]), user_token='0001')
self.assertFalse(r.context["ip_exists"])
self.assertEqual(list(r.context["ips"]), [])
# ip exists
r = self.client.get(reverse('admin-details',
args=["195.251.222.211"]), user_token='0001')
self.assertTrue(r.context["ip_exists"])
ips = r.context["ips"]
for ip in ips:
self.assertEqual(ip.address, "195.251.222.211")
def test_vm_lookup(self):
# vm id does not exist
r = self.client.get(reverse('admin-details',
args=["vm-123"]), user_token='0001')
self.assertContains(r, 'User with Virtual Machine')
# vm exists, 'test' account discovered
r = self.client.get(reverse('admin-details',
args=["vm1001"]), user_token='0001')
self.assertEqual(r.context['account'], USER1)
r = self.client.get(reverse('admin-details',
args=["vm1002"]), user_token='0001')
self.assertEqual(r.context['account'], USER2)
# dash also works
r = self.client.get(reverse('admin-details',
args=["vm-1002"]), user_token='0001')
self.assertEqual(r.context['account'], USER2)
def test_view_permissions(self):
# anonymous user gets 403
r = self.client.get(reverse('admin-index'), user_token=None)
self.assertEqual(r.status_code, 403)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token=None)
self.assertEqual(r.status_code, 403)
# user not in admin group gets 403
r = self.client.get(reverse('admin-index'))
self.assertEqual(r.status_code, 403)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']))
self.assertEqual(r.status_code, 403)
# user with admin group gets 200
r = self.client.get(reverse('admin-index'), user_token="0001")
self.assertEqual(r.status_code, 200)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
self.assertEqual(r.status_code, 200)
r = self.client.post(reverse('admin-suspend-vm', args=(1001,)))
r = self.client.get(reverse('admin-suspend-vm', args=(1001,)),
user_token="0001", data={'token': '1234'})
self.assertEqual(r.status_code, 403)
r = self.client.get(reverse('admin-suspend-vm', args=(1001,)),
user_token="0001")
self.assertEqual(r.status_code, 403)
r = self.client.post(reverse('admin-suspend-vm', args=(1001,)),
user_token="0001", data={'token': '0001'})
self.assertEqual(r.status_code, 302)
r = self.client.post(reverse('admin-suspend-vm', args=(1001,)),
user_token="0000", data={'token': '0000'})
self.assertEqual(r.status_code, 403)
def test_suspend_vm(self):
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
self.assertEqual(r.status_code, 200)
vmid = r.context['vms'][0].pk
r = self.client.post(reverse('admin-suspend-vm', args=(vmid,)),
data={'token': '0001'}, user_token="0001")
self.assertEqual(r.status_code, 302)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
self.assertTrue(r.context['vms'][0].suspended)
r = self.client.post(reverse('admin-suspend-vm-release',
args=(vmid,)), data={'token': '0001'},
user_token="0001")
self.assertEqual(r.status_code, 302)
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
self.assertFalse(r.context['vms'][0].suspended)
def test_results_get_filtered(self):
"""
Test that view context data are filtered based on userid provided.
Check admin_test.json to see the existing database data.
"""
# 'testuser@test.com' details, see
# helpdes/fixtures/admin_test.json for more details
r = self.client.get(reverse('admin-details',
args=['testuser@test.com']),
user_token="0001")
account = r.context['account']
vms = r.context['vms']
nets = r.context['networks']
self.assertEqual(account, USER1)
self.assertEqual(vms[0].name, "user1 vm")
self.assertEqual(vms.count(), 1)
self.assertEqual(len(nets), 2)
self.assertEqual(r.context['account_exists'], True)
# 'testuser2@test.com' details, see admin
# /fixtures/admin_test.json for more details
r = self.client.get(reverse('admin-details',
args=['testuser2@test.com']),
user_token="0001")
account = r.context['account']
vms = r.context['vms']
nets = r.context['networks']
self.assertEqual(account, USER2)
self.assertEqual(vms.count(), 2)
self.assertEqual(sorted([vms[0].name, vms[1].name]),
sorted(["user2 vm1", "user2 vm2"]))
self.assertEqual(len(nets), 0)
self.assertEqual(r.context['account_exists'], True)
# 'testuser5@test.com' does not exist, should be redirected to
# admin home
r = self.client.get(reverse('admin-details',
args=['testuser5@test.com']),
user_token="0001")
vms = r.context['vms']
self.assertEqual(r.context['account_exists'], False)
self.assertEqual(vms.count(), 0)
def test_start_shutdown(self):
from synnefo.logic import backend
self.vm1 = mfactory.VirtualMachineFactory(userid=USER1)
pk = self.vm1.pk
r = self.client.post(reverse('admin-vm-shutdown', args=(pk,)))
self.assertEqual(r.status_code, 403)
r = self.client.post(reverse('admin-vm-shutdown', args=(pk,)),
data={'token': '0001'})
self.assertEqual(r.status_code, 403)
backend.shutdown_instance = shutdown = mock.Mock()
shutdown.return_value = 1
self.vm1.operstate = 'STARTED'
self.vm1.save()
with mocked_quotaholder():
r = self.client.post(reverse('admin-vm-shutdown', args=(pk,)),
data={'token': '0001'}, user_token='0001')
self.assertEqual(r.status_code, 302)
self.assertTrue(shutdown.called)
self.assertEqual(len(shutdown.mock_calls), 1)
backend.startup_instance = startup = mock.Mock()
startup.return_value = 2
self.vm1.operstate = 'STOPPED'
self.vm1.save()
with mocked_quotaholder():
r = self.client.post(reverse('admin-vm-start', args=(pk,)),
data={'token': '0001'}, user_token='0001')
self.assertEqual(r.status_code, 302)
self.assertTrue(startup.called)
self.assertEqual(len(startup.mock_calls), 1)
# Copyright 2012 - 2014 GRNET S.A. All rights reserved.
# Copyright (C) 2010-2014 GRNET S.A.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED