diff --git a/tcp_tests/managers/backup_restore_manager.py b/tcp_tests/managers/backup_restore_manager.py
index e3b8c23..365ff6f 100644
--- a/tcp_tests/managers/backup_restore_manager.py
+++ b/tcp_tests/managers/backup_restore_manager.py
@@ -13,33 +13,68 @@
 #    under the License.
 
 from tcp_tests import logger
+from tcp_tests.managers.execute_commands import ExecuteCommandsMixin
 
 
 LOG = logger.logger
 
 
-class BackupRestoreManager(object):
+class BackupRestoreManager(ExecuteCommandsMixin):
     """Helper manager for execution backup restore"""
 
-    backup_cmd = 'backupninja -n --run /etc/backup.d/200.backup.rsync'
-
-    def __init__(self, underlay, salt_api, backup_cmd=None):
+    def __init__(self, config, underlay, salt_api):
+        self.__config = config
         self.underlay = underlay
         self.__salt_api = salt_api
-        self.backup_cmd = backup_cmd or self.backup_cmd
+        super(BackupRestoreManager, self).__init__(config, underlay)
 
     @property
     def salt_api(self):
         return self.__salt_api
 
-    def create_backup(self, tgt, backup_cmd=backup_cmd):
-        return self.salt_api.enforce_state(tgt, 'cmd.run', backup_cmd)
+    def get_node_name(self, tgt):
+        res = [node_name for node_name in
+               self.underlay.node_names() if tgt in node_name]
+        assert len(res) > 0, 'Can not find node name by tgt {}'.format(tgt)
+        return res[0]
 
-    def restore_salt_master(self, tgt):
-        return self.salt_api.local(tgt, 'salt.master.restore')
+    def create_backup(self, tgt, backup_cmd=None):
+        if not backup_cmd:
+            backup_cmd = 'backupninja -n --run /etc/backup.d/200.backup.rsync'
+        step = {'cmd': backup_cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step, 'Running backup command')
 
-    def restore_salt_minion(self, tgt):
-        return self.salt_api.local(tgt, 'salt.minion.restore')
+    def check_file_exists(self, tgt, file_path=None):
+        if not file_path:
+            file_path = '/etc/backup.d/200.backup.rsync'
+        cmd = 'test -f {}'.format(file_path)
+        step = {'cmd': cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step, 'Check file {} exists'.format(file_path))
+
+    def delete_dirs_files(self, tgt, file_path='/etc/pki/ca/salt_master_ca/'):
+        cmd = 'rm -rf {}'.format(file_path)
+        step = {'cmd': cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step, 'Delete {}'.format(file_path))
+
+    def restore_salt(self, tgt):
+        cmd = 'salt-call state.sls salt.master.restore,salt.minion.restore'
+        step = {'cmd': cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step, 'Restore salt master')
+
+    def ping_minions(self, tgt):
+        cmd = 'salt "*" test.ping'
+        step = {'cmd': cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step, 'Ping minions')
+
+    def verify_salt_master_restored(self, tgt):
+        cmd = "salt -t2 '*' saltutil.refresh_pillar"
+        step = {'cmd': cmd, 'node_name': self.get_node_name(tgt)}
+        self.execute_command(step,
+                             'Verify that the Salt Master node is restored')
+        step = {'cmd': 'ls -la /etc/pki/ca/salt_master_ca/',
+                'node_name': self.get_node_name(tgt)}
+        self.execute_command(step,
+                             'Check pki files exists')
 
     def create_mysql_backup_backupninja(self, tgt, ):
         rets = []
@@ -56,7 +91,7 @@
         # for every restored database in /root/mysql/flags.
         return self.salt_api.local(tgt, 'mysql.client')
 
-    def create_mysql_xtrabackup(self, tgt, backup_cmd=backup_cmd):
+    def create_mysql_xtrabackup(self, tgt, backup_cmd=None):
         # Should be run on mysql master node
         return self.salt_api.enforce_state(
             tgt, 'cmd.run', '/usr/local/bin/innobackupex-runner.sh')
@@ -76,7 +111,7 @@
         return self.salt_api.enforce_state(tgt, 'service.stop mysql')
 
     def disconnect_wresp_master(self, tgt='I@galera:master'):
-        # TODO fins the way updated wresp
+        # TODO finds the way updated wresp
         return self.salt_api.enforce_state(
             tgt, 'cmd.run', 'wsrep_cluster_address=gcomm://')
 
diff --git a/tcp_tests/managers/execute_commands.py b/tcp_tests/managers/execute_commands.py
index 991fb58..ba12678 100644
--- a/tcp_tests/managers/execute_commands.py
+++ b/tcp_tests/managers/execute_commands.py
@@ -114,6 +114,8 @@
                         failed += 1
                     if s.startswith("[CRITICAL]"):
                         failed += 1
+                    if 'Fatal' in s:
+                        failed += 1
 
                 if result.exit_code != 0:
                     time.sleep(retry_delay)
diff --git a/tcp_tests/tests/system/test_backup_restore.py b/tcp_tests/tests/system/test_backup_restore.py
new file mode 100644
index 0000000..d63433b
--- /dev/null
+++ b/tcp_tests/tests/system/test_backup_restore.py
@@ -0,0 +1,72 @@
+#    Copyright 2018 Mirantis, Inc.
+#
+#    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 tcp_tests import logger
+from tcp_tests.managers import backup_restore_manager
+
+LOG = logger.logger
+
+
+class TestBackupRestoreMaster(object):
+    """Test class for testing backup restore of master node"""
+
+    def test_backup_cfg_backupninja_rsync(
+            self, underlay, config, openstack_deployed,
+            salt_actions, show_step):
+        """Test add policy for Nova service
+
+        Scenario:
+            1. Prepare salt on hosts
+            2. Setup controller nodes
+            3. Setup compute nodes
+            4. Check config for rsync exists
+            5. Run backup command
+            6. Delete salt master pki
+            7. Run restore
+            8. Check pki was restored
+            9. Check minions work fine with master
+
+        """
+        backup = backup_restore_manager.BackupRestoreManager(
+            config=config, underlay=underlay, salt_api=salt_actions)
+        # STEP #1,2,3
+        show_step(1)
+        show_step(2)
+        show_step(3)
+
+        # STEP #4
+        show_step(4)
+        backup.check_file_exists('cfg01')
+
+        # STEP #5
+        show_step(5)
+        backup.create_backup('cfg01')
+
+        # STEP #6
+        show_step(6)
+        backup.delete_dirs_files('cfg01')
+
+        # STEP #7
+        show_step(7)
+        backup.restore_salt('cfg01')
+
+        # STEP #8
+        show_step(8)
+        backup.verify_salt_master_restored('cfg01')
+
+        # STEP #9
+        show_step(9)
+        backup.ping_minions('cfg01')
+
+        LOG.info("*************** DONE **************")
