Fix handle_restore for server and volume resources

When resource references are used for properties restore
does not work for nova server and volume resources.

This patch fixes it and adds a functional test for it.

Change-Id: I34efb3f4e0d3578d95134793f5c5d413667790e0
Closes-Bug: #1687009
diff --git a/common/test.py b/common/test.py
index 842f4e7..9944bd1 100644
--- a/common/test.py
+++ b/common/test.py
@@ -614,6 +614,17 @@
         info = self.client.stacks.abandon(stack_id=stack_id)
         return info
 
+    def stack_snapshot(self, stack_id,
+                       wait_for_status='SNAPSHOT_COMPLETE'):
+        snapshot = self.client.stacks.snapshot(stack_id=stack_id)
+        self._wait_for_stack_status(stack_id, wait_for_status)
+        return snapshot['id']
+
+    def stack_restore(self, stack_id, snapshot_id,
+                      wait_for_status='RESTORE_COMPLETE'):
+        self.client.stacks.restore(stack_id, snapshot_id)
+        self._wait_for_stack_status(stack_id, wait_for_status)
+
     def stack_suspend(self, stack_identifier):
         if (self.conf.skip_test_stack_action_list and
                 'SUSPEND' in self.conf.skip_test_stack_action_list):