diff --git a/designate_tempest_plugin/services/dns/v2/json/zone_exports_client.py b/designate_tempest_plugin/services/dns/v2/json/zone_exports_client.py
index 3bbd6c9..8915ceb 100644
--- a/designate_tempest_plugin/services/dns/v2/json/zone_exports_client.py
+++ b/designate_tempest_plugin/services/dns/v2/json/zone_exports_client.py
@@ -43,16 +43,17 @@
         return resp, body
 
     @base.handle_errors
-    def show_zone_export(self, uuid, params=None):
+    def show_zone_export(self, uuid, params=None, headers=None):
         """Get the zone export task
 
         :param uuid: Unique identifier of the zone export task in UUID format.
         :param params: A Python dict that represents the query paramaters to
                        include in the request URI.
+        :param headers (dict): The headers to use for the request.
         :return: Serialized exported zone as a dictionary.
         """
         return self._show_request(
-             'zones/tasks/exports', uuid, params=params)
+             'zones/tasks/exports', uuid, params=params, headers=headers)
 
     @base.handle_errors
     def show_exported_zonefile(self, uuid, params=None):
@@ -70,15 +71,16 @@
             headers=headers, params=params)
 
     @base.handle_errors
-    def list_zone_exports(self, params=None):
+    def list_zone_exports(self, params=None, headers=None):
         """List zone export tasks
 
         :param params: A Python dict that represents the query paramaters to
                        include in the request URI.
+        :param headers (dict): The headers to use for the request.
         :return: Serialized exported zone as a list.
         """
         return self._list_request(
-            'zones/tasks/exports', params=params)
+            'zones/tasks/exports', params=params, headers=headers)
 
     @base.handle_errors
     def delete_zone_export(self, uuid, params=None):
diff --git a/designate_tempest_plugin/tests/api/v2/test_zones_exports.py b/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
index 13cd077..34a2c41 100644
--- a/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
+++ b/designate_tempest_plugin/tests/api/v2/test_zones_exports.py
@@ -27,6 +27,8 @@
 
 
 class ZonesExportTest(BaseZoneExportsTest):
+    credentials = ['primary', 'admin', 'alt']
+
     @classmethod
     def setup_credentials(cls):
         # Do not create network resources for these test.
@@ -38,7 +40,10 @@
         super(ZonesExportTest, cls).setup_clients()
 
         cls.zone_client = cls.os_primary.zones_client
+        cls.alt_zone_client = cls.os_alt.zones_client
         cls.client = cls.os_primary.zone_exports_client
+        cls.alt_client = cls.os_alt.zone_exports_client
+        cls.admin_client = cls.os_admin.zone_exports_client
 
     @decorators.idempotent_id('2dd8a9a0-98a2-4bf6-bb51-286583b30f40')
     def test_create_zone_export(self):
@@ -53,6 +58,12 @@
         LOG.info('Ensure we respond with PENDING')
         self.assertEqual('PENDING', zone_export['status'])
 
+    @decorators.idempotent_id('76ab8ec4-95fd-11eb-b1cd-74e5f9e2a801')
+    def test_create_zone_export_using_invalid_zone_id(self):
+        self.assertRaises(
+            lib_exc.NotFound, self.client.create_zone_export,
+            'e35bc796-9841-11eb-898b-74e5f9e2a801')
+
     @decorators.attr(type='smoke')
     @decorators.idempotent_id('2d29a2a9-1941-4b7e-9d8a-ad6c2140ea68')
     def test_show_zone_export(self):
@@ -70,6 +81,29 @@
         LOG.info('Ensure the fetched response matches the zone export')
         self.assertExpected(zone_export, body, self.excluded_keys)
 
+    @decorators.idempotent_id('fb04507c-9600-11eb-b1cd-74e5f9e2a801')
+    def test_show_zone_export_impersonate_another_project(self):
+        LOG.info('Create a zone')
+        zone = self.zone_client.create_zone()[1]
+        self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'])
+
+        LOG.info('Create a zone export using primary client')
+        resp, zone_export = self.client.create_zone_export(zone['id'])
+        self.addCleanup(self.client.delete_zone_export, zone_export['id'])
+
+        LOG.info('Impersonate "primary" client, to show created zone exports')
+        body = self.admin_client.show_zone_export(uuid=None, headers={
+            'x-auth-sudo-project-id': zone['project_id']})[1]['exports']
+        listed_export_ids = [item['id'] for item in body]
+
+        LOG.info('Ensure that the fetched response, contains the ID '
+                 'for a zone export created by primary client.')
+        self.assertIn(
+            zone_export['id'], listed_export_ids,
+            'Failed, expected ID:{} was not found in listed export zones '
+            'for a primary client: {}'.format(
+                zone_export['id'], listed_export_ids))
+
     @decorators.idempotent_id('97234f00-8bcb-43f8-84dd-874f8bc4a80e')
     def test_delete_zone_export(self):
         LOG.info('Create a zone')
@@ -100,3 +134,59 @@
         _, body = self.client.list_zone_exports()
 
         self.assertGreater(len(body['exports']), 0)
+
+    @decorators.idempotent_id('f34e7f34-9613-11eb-b1cd-74e5f9e2a801')
+    def test_list_zone_exports_all_projects(self):
+        LOG.info('Create a primary zone and its export')
+        primary_zone = self.zone_client.create_zone()[1]
+        self.addCleanup(
+            self.wait_zone_delete, self.zone_client, primary_zone['id'])
+        primary_export = self.client.create_zone_export(primary_zone['id'])[1]
+        self.addCleanup(self.client.delete_zone_export, primary_export['id'])
+
+        LOG.info('Create an alt zone and its export')
+        alt_zone = self.alt_zone_client.create_zone()[1]
+        self.addCleanup(
+            self.wait_zone_delete, self.alt_zone_client, alt_zone['id'])
+        alt_export = self.alt_client.create_zone_export(alt_zone['id'])[1]
+        self.addCleanup(self.alt_client.delete_zone_export, alt_export['id'])
+
+        LOG.info('As admin user list zone exports for all projects')
+        listed_exports_ids = [
+            item['id'] for item in self.admin_client.list_zone_exports(
+                headers={'x-auth-all-projects': True})[1]['exports']]
+
+        LOG.info('Make sure that all previously created zone '
+                 'export IDs are listed')
+        for id in [primary_export['id'], alt_export['id']]:
+            self.assertIn(
+                id, listed_exports_ids,
+                'Failed, expected ID:{} was not found in '
+                'listed IDs:{}'.format(id, listed_exports_ids))
+
+    @decorators.idempotent_id('943dad4a-9617-11eb-b1cd-74e5f9e2a801')
+    def test_export_not_your_zone(self):
+        LOG.info('Create a primary zone.')
+        primary_zone = self.zone_client.create_zone()[1]
+        self.addCleanup(
+            self.wait_zone_delete, self.zone_client, primary_zone['id'])
+
+        LOG.info('Make sure that "404 NotFound" status code is raised.')
+        self.assertRaises(
+            lib_exc.NotFound, self.alt_client.create_zone_export,
+            primary_zone['id'])
+
+    @decorators.idempotent_id('518dc308-9604-11eb-b1cd-74e5f9e2a801')
+    def test_create_zone_export_using_deleted_zone(self):
+        LOG.info('Create a zone')
+        zone = self.zone_client.create_zone()[1]
+        self.addCleanup(self.wait_zone_delete, self.zone_client, zone['id'],
+                        ignore_errors=lib_exc.NotFound)
+
+        LOG.info("Delete the zone and wait till it's done.")
+        self.zone_client.delete_zone(zone['id'])[1]
+        self.wait_zone_delete(self.zone_client, zone['id'])
+
+        LOG.info('Ensure we respond with NotFound exception')
+        self.assertRaises(
+            lib_exc.NotFound, self.client.create_zone_export, zone['id'])
