This file is indexed.

/usr/lib/python3/dist-packages/designateclient/functionaltests/v2/test_zone_export.py is in python3-designateclient 2.9.0-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
Copyright 2016 Rackspace

Author: Rahman Syed <rahman.syed@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from designateclient.functionaltests.base import BaseDesignateTest
from designateclient.functionaltests.datagen import random_zone_name
from designateclient.functionaltests.v2.fixtures import ExportFixture
from designateclient.functionaltests.v2.fixtures import ZoneFixture


class TestZoneExport(BaseDesignateTest):

    def setUp(self):
        super(TestZoneExport, self).setUp()
        self.ensure_tld_exists('com')
        fixture = self.useFixture(ZoneFixture(
            name=random_zone_name(),
            email='test@example.com',
        ))
        self.zone = fixture.zone

    def test_list_zone_exports(self):
        zone_export = self.useFixture(ExportFixture(
            zone=self.zone
        )).zone_export

        zone_exports = self.clients.zone_export_list()
        self.assertGreater(len(zone_exports), 0)
        self.assertTrue(self._is_entity_in_list(zone_export, zone_exports))

    def test_create_and_show_zone_export(self):
        zone_export = self.useFixture(ExportFixture(
            zone=self.zone
        )).zone_export

        fetched_export = self.clients.zone_export_show(zone_export.id)

        self.assertEqual(zone_export.created_at, fetched_export.created_at)
        self.assertEqual(zone_export.id, fetched_export.id)
        self.assertEqual(zone_export.message, fetched_export.message)
        self.assertEqual(zone_export.project_id, fetched_export.project_id)
        self.assertEqual(zone_export.zone_id, fetched_export.zone_id)

    def test_delete_zone_export(self):
        zone_export = self.useFixture(ExportFixture(
            zone=self.zone
        )).zone_export

        zone_exports = self.clients.zone_export_list()
        self.assertTrue(self._is_entity_in_list(zone_export, zone_exports))

        self.clients.zone_export_delete(zone_export.id)

        zone_exports = self.clients.zone_export_list()
        self.assertFalse(self._is_entity_in_list(zone_export, zone_exports))

    def test_show_export_file(self):
        zone_export = self.useFixture(ExportFixture(
            zone=self.zone
        )).zone_export

        fetched_export = self.clients.zone_export_showfile(zone_export.id)

        self.assertIn('$ORIGIN', fetched_export.data)
        self.assertIn('$TTL', fetched_export.data)
        self.assertIn('SOA', fetched_export.data)
        self.assertIn('NS', fetched_export.data)
        self.assertIn(self.zone.name, fetched_export.data)