diff --git a/tcp_tests/fixtures/salt_fixtures.py b/tcp_tests/fixtures/salt_fixtures.py
new file mode 100644
index 0000000..e22b16f
--- /dev/null
+++ b/tcp_tests/fixtures/salt_fixtures.py
@@ -0,0 +1,89 @@
+#    Copyright 2016 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.
+
+import os
+
+import pytest
+import yaml
+
+from tcp_tests import logger
+from tcp_tests.helpers import ext
+from tcp_tests import settings
+from tcp_tests.managers import saltmanager
+
+LOG = logger.logger
+
+
+@pytest.fixture(scope='function')
+def salt_actions(config, underlay):
+    """Fixture that provides various actions for K8S
+
+    :param config: fixture provides oslo.config
+    :param underlay: fixture provides underlay manager
+    :rtype: K8SManager
+
+    For use in tests or fixtures to deploy a custom K8S
+    """
+    return saltmanager.SaltManager(config, underlay)
+
+
+@pytest.fixture(scope='function')
+def salt_deployed(revert_snapshot, request, config,
+                  hardware, underlay, salt_actions):
+    """Fixture to get or install TCP on environment
+
+    :param request: fixture provides pytest data
+    :param config: fixture provides oslo.config
+    :param hardware: fixture provides enviromnet manager
+    :param underlay: fixture provides underlay manager
+    :param tcp_actions: fixture provides TCPManager instance
+    :rtype: TCPManager
+
+    If config.tcp.tcp_host is not set, this fixture assumes that
+    the tcp cluster was not deployed, and do the following:
+    - deploy tcp cluster
+    - make snapshot with name 'tcp_deployed'
+    - return TCPCluster instance
+
+    If config.tcp.tcp_host was set, this fixture assumes that the tcp
+    cluster was already deployed, and do the following:
+    - return TCPCluster instance
+
+    If you want to revert 'tcp_deployed' snapshot, please use mark:
+    @pytest.mark.revert_snapshot("tcp_deployed")
+    """
+    # If no snapshot was reverted, then try to revert the snapshot
+    # that belongs to the fixture.
+    # Note: keep fixtures in strict dependences from each other!
+    if not revert_snapshot:
+        if hardware.has_snapshot(ext.SNAPSHOT.salt_deployed) and \
+                hardware.has_snapshot_config(ext.SNAPSHOT.salt_deployed):
+            hardware.revert_snapshot(ext.SNAPSHOT.salt_deployed)
+
+    # Create Salt cluster
+    if config.salt.salt_master_host == '0.0.0.0':
+        with underlay.yaml_editor(
+                config.salt_deploy.salt_steps_path) as commands:
+            salt_actions.install(commands.content)
+        hardware.create_snapshot(ext.SNAPSHOT.salt_deployed)
+
+    else:
+        # 1. hardware environment created and powered on
+        # 2. config.underlay.ssh contains SSH access to provisioned nodes
+        #    (can be passed from external config with TESTS_CONFIGS variable)
+        # 3. config.tcp.* options contain access credentials to the already
+        #    installed TCP API endpoint
+        pass
+
+    return salt_actions
