Fix update of shared QoS policy

When user updates QoS policy which is globaly shared, it will be still
marked as globally shared even if this flag was not set explicitly
in update request.
For example, updating description of QoS policy will not change shared
flag to default value which is "False".

Co-Authored-By: Haim Daniel <hdaniel@redhat.com>

Change-Id: I2c59e71eae0bf2e73475bba321afc4aaa514b317
Closes-Bug: #1585373
diff --git a/neutron/tests/tempest/api/test_qos.py b/neutron/tests/tempest/api/test_qos.py
index 24ef38b..69baa63 100644
--- a/neutron/tests/tempest/api/test_qos.py
+++ b/neutron/tests/tempest/api/test_qos.py
@@ -75,6 +75,24 @@
         self.assertTrue(retrieved_policy['shared'])
         self.assertEqual([], retrieved_policy['rules'])
 
+    @test.idempotent_id('ee263db4-009a-4641-83e5-d0e83506ba4c')
+    def test_shared_policy_update(self):
+        policy = self.create_qos_policy(name='test-policy',
+                                        description='',
+                                        shared=True)
+
+        self.admin_client.update_qos_policy(policy['id'],
+                                            description='test policy desc2')
+        retrieved_policy = self.admin_client.show_qos_policy(policy['id'])
+        retrieved_policy = retrieved_policy['policy']
+        self.assertTrue(retrieved_policy['shared'])
+
+        self.admin_client.update_qos_policy(policy['id'],
+                                            shared=False)
+        retrieved_policy = self.admin_client.show_qos_policy(policy['id'])
+        retrieved_policy = retrieved_policy['policy']
+        self.assertFalse(retrieved_policy['shared'])
+
     @test.idempotent_id('1cb42653-54bd-4a9a-b888-c55e18199201')
     def test_delete_policy(self):
         policy = self.admin_client.create_qos_policy(