diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
index 678fcfc..414305d 100644
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -95,32 +95,17 @@
         vol_name = data_utils.rand_name('volume')
         return self.create_volume(name=vol_name, snapshot_id=snap_id)
 
-    def _ssh_to_server(self, server, keypair):
+    def _get_server_ip(self, server):
         if CONF.compute.use_floatingip_for_ssh:
             ip = self.create_floating_ip(server)['ip']
         else:
             ip = server
-
-        return self.get_remote_client(ip, private_key=keypair['private_key'],
-                                      log_console_of_servers=[server])
-
-    def _get_content(self, ssh_client):
-        return ssh_client.exec_command('cat /tmp/text')
-
-    def _write_text(self, ssh_client):
-        text = data_utils.rand_name('text')
-        ssh_client.exec_command('echo "%s" > /tmp/text; sync' % (text))
-
-        return self._get_content(ssh_client)
+        return ip
 
     def _delete_server(self, server):
         self.servers_client.delete_server(server['id'])
         waiters.wait_for_server_termination(self.servers_client, server['id'])
 
-    def _check_content_of_written_file(self, ssh_client, expected):
-        actual = self._get_content(ssh_client)
-        self.assertEqual(expected, actual)
-
     @test.idempotent_id('557cd2c2-4eb8-4dce-98be-f86765ff311b')
     @test.attr(type='smoke')
     @test.services('compute', 'volume', 'image')
@@ -134,9 +119,9 @@
                                                        keypair, security_group)
 
         # write content to volume on instance
-        ssh_client_for_instance_1st = self._ssh_to_server(instance_1st,
-                                                          keypair)
-        text = self._write_text(ssh_client_for_instance_1st)
+        ip_instance_1st = self._get_server_ip(instance_1st)
+        timestamp = self.create_timestamp(ip_instance_1st,
+                                          private_key=keypair['private_key'])
 
         # delete instance
         self._delete_server(instance_1st)
@@ -146,9 +131,10 @@
                                                        keypair, security_group)
 
         # check the content of written file
-        ssh_client_for_instance_2nd = self._ssh_to_server(instance_2nd,
-                                                          keypair)
-        self._check_content_of_written_file(ssh_client_for_instance_2nd, text)
+        ip_instance_2nd = self._get_server_ip(instance_2nd)
+        timestamp2 = self.get_timestamp(ip_instance_2nd,
+                                        private_key=keypair['private_key'])
+        self.assertEqual(timestamp, timestamp2)
 
         # snapshot a volume
         snapshot = self._create_snapshot_from_volume(volume_origin['id'])
@@ -160,8 +146,10 @@
                                             keypair, security_group))
 
         # check the content of written file
-        ssh_client = self._ssh_to_server(instance_from_snapshot, keypair)
-        self._check_content_of_written_file(ssh_client, text)
+        ip_instance_from_snapshot = self._get_server_ip(instance_from_snapshot)
+        timestamp3 = self.get_timestamp(ip_instance_from_snapshot,
+                                        private_key=keypair['private_key'])
+        self.assertEqual(timestamp, timestamp3)
 
     @test.idempotent_id('36c34c67-7b54-4b59-b188-02a2f458a63b')
     @test.services('compute', 'volume', 'image')
