diff --git a/test/mocks/emssimulator/install.sh b/test/mocks/emssimulator/install.sh
new file mode 100755
index 0000000..e3069aa
--- /dev/null
+++ b/test/mocks/emssimulator/install.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+readonly old_pwd=$PWD
+cd swm/sw_server_simulator
+
+for i in `ls -1`; do
+	if [ -d $i ]; then
+		cd $i
+		echo $i
+		zip -r ${i}.zip *
+		mv ${i}.zip ..
+		cd $OLDPWD
+	fi
+done
+
+cd $old_pwd
+
diff --git a/test/mocks/emssimulator/requirements.txt b/test/mocks/emssimulator/requirements.txt
new file mode 100644
index 0000000..feca32d
--- /dev/null
+++ b/test/mocks/emssimulator/requirements.txt
@@ -0,0 +1 @@
+jsonpath
diff --git a/test/mocks/emssimulator/swm/__init__.py b/test/mocks/emssimulator/swm/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/mocks/emssimulator/swm/__init__.py
diff --git a/test/mocks/emssimulator/swm/activateNESw b/test/mocks/emssimulator/swm/activateNESw
new file mode 100755
index 0000000..67d233e
--- /dev/null
+++ b/test/mocks/emssimulator/swm/activateNESw
@@ -0,0 +1,135 @@
+#!/usr/bin/python
+
+import sys
+import argparse
+import json
+import os
+import shutil
+import random
+import time
+
+import conf
+import ems_util
+
+
+def do_activate_sw(sw_version_to_be_activated, ne_info):
+    """
+    return err, reason
+    """
+
+    installed_sw = ne_info.get("installedSw", {})
+    if sw_version_to_be_activated in installed_sw:
+        target_sw_version = installed_sw[sw_version_to_be_activated]["version"]
+    else:
+        target_sw_version = sw_version_to_be_activated
+
+    sw_install_dir_in_ne = conf.PNF_SIMULATORS_DIR + '/' + ne_info['omIP'] + conf.PNF_SW_INSTALL_DIR
+    target_sw_dir = sw_install_dir_in_ne + '/' + target_sw_version
+    if not os.path.isdir(target_sw_dir):
+        return True, "SW to be activated does not install"
+
+    if "targetSwVersion" in ne_info:
+        if ne_info["targetSwVersion"] != target_sw_version:
+            return True, "Conflicted targetVersion with to be activated %s" % target_sw_version
+        del ne_info["targetSwVersion"]
+
+    old_sw_version = ne_info.get("oldSwVersion", "")
+
+    if target_sw_version != ne_info["currentSwVersion"]:
+        ne_info["oldSwVersion"] = ne_info["currentSwVersion"]
+        ne_info["currentSwVersion"] = target_sw_version
+        ne_info["status"] = conf.STATUS_ACTIVATING
+        ems_util.update_ne_info(ne_info)
+
+        if target_sw_version != old_sw_version:
+            old_sw_dir = sw_install_dir_in_ne + '/' + old_sw_version
+            if old_sw_version and os.path.isdir(old_sw_dir):
+                shutil.rmtree(old_sw_dir, ignore_errors=True)
+
+    old_cwd = os.getcwd()
+    os.chdir(sw_install_dir_in_ne)
+    if os.path.islink(conf.CURRENT_VERSION_DIR):
+        os.remove(conf.CURRENT_VERSION_DIR)
+    os.symlink(target_sw_version, conf.CURRENT_VERSION_DIR)
+    os.chdir(old_cwd)
+
+    if "downloadedSwLocation" in ne_info:
+        if os.path.isdir(ne_info["downloadedSwLocation"]):
+            shutil.rmtree(ne_info["downloadedSwLocation"], ignore_errors=True)
+        del ne_info["downloadedSwLocation"]
+
+    return False, None
+
+
+def generate_notification(activate_process_id, activate_status, sw_version, failure_reason):
+    notification = {
+        "objectClass": "EMSClass",
+        "objectInstance": "EMSInstance",
+        "notificationId": random.randint(1, conf.MAX_INT),
+        "eventTime": time.asctime(),
+        "systemDN": "emssimulator",
+        "notificationType": "notifyActivateNESwStatusChanged",
+        "activateProcessId": activate_process_id,
+        "activateOperationStatus": activate_status,
+        "swVersion": sw_version
+    }
+
+    if failure_reason:
+        notification["failureReason"] = failure_reason
+
+    return notification
+
+
+def activate_ne_sw(sw_version_to_be_activated, ne_id):
+    ne_info = ems_util.get_ne_info_from_db_by_id(ne_id)
+
+    activate_process_id = random.randint(1, conf.MAX_INT)
+    result = conf.REQ_SUCCESS
+    ret_value = {
+        "activateProcessId": activate_process_id,
+        "result": result
+    }
+
+    if not ne_info:
+        ret_value["result"] = conf.REQ_FAILURE
+        ret_value["reason"] = "Can not find NE %s" % ne_id
+        return ret_value
+
+    err, reason = do_activate_sw(sw_version_to_be_activated, ne_info)
+
+    if not err:
+        ne_info["status"] = conf.STATUS_ACTIVATED
+        ems_util.update_ne_info(ne_info)
+        activate_status = "NE_SWACTIVATION_SUCCESSFUL"
+    else:
+        ret_value["result"] = conf.REQ_FAILURE
+        ret_value["reason"] = reason
+
+        activate_status = "NE_SWACTIVATION_FAILED"
+
+    notification = generate_notification(activate_process_id, activate_status, sw_version_to_be_activated, reason)
+    ems_util.send_notification(notification, activate_process_id)
+
+    # for automated software management, there is no listOfStepNumbersAndDurations
+    return ret_value
+
+
+def main():
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument("--swVersionToBeActivated", help="The NE software version to be activated", required=True)
+    parser.add_argument("--neIdentifier", help="The NE where the software can be activated", required=True)
+
+    args = parser.parse_args()
+
+    ret_value = activate_ne_sw(args.swVersionToBeActivated, args.neIdentifier)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.REQ_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/test/mocks/emssimulator/swm/conf.py b/test/mocks/emssimulator/swm/conf.py
new file mode 100644
index 0000000..d7ba5b4
--- /dev/null
+++ b/test/mocks/emssimulator/swm/conf.py
@@ -0,0 +1,37 @@
+#!/usr/bin/python
+
+import sys
+
+SWM_DIR = sys.path[0]
+
+NE_INFO_TABLE = SWM_DIR + "/ems_db/ne_info_table.json"
+SW_SERVER_SIMULATOR = SWM_DIR + "/sw_server_simulator"
+PNF_SIMULATORS_DIR = SWM_DIR + "/pnf_simulators"
+PNF_SW_DOWNLOAD_DIR = "/opt/download"
+PNF_SW_INSTALL_DIR = "/opt/install"
+PNF_SW_FALLBACK_DIR = "/opt/fallback"
+MANIFEST_FILE = "manifest.json"
+INSTALLED_SW = "installed_sw.json"
+CURRENT_VERSION_DIR = "current"
+NOTIFICATION_DIR = "/tmp"
+
+MAX_INT = (2**32) - 1
+
+STATUS_DOWNLOADING = "Downloading"
+STATUS_INSTALLING = "Installing"
+STATUS_ACTIVATING = "Activating"
+STATUS_ACTIVATED = "Activated"
+
+STATUS_PRECHECKED = "PreChecked"
+STATUS_POSTCHECKED = "PostChecked"
+
+REQ_SUCCESS = "requestAccepted"
+REQ_FAILURE = "requestFailed"
+
+RET_CODE_SUCCESS = 0
+RET_CODE_FAILURE = 1
+
+RESULT_SUCCESS = "Success"
+RESULT_FAILURE = "Failure"
+RESULT_PARTLY = "Partly successful"
+
diff --git a/test/mocks/emssimulator/swm/downloadNESw b/test/mocks/emssimulator/swm/downloadNESw
new file mode 100755
index 0000000..06a8d6b
--- /dev/null
+++ b/test/mocks/emssimulator/swm/downloadNESw
@@ -0,0 +1,154 @@
+#!/usr/bin/python
+
+import sys
+import argparse
+import json
+import os
+import shutil
+import random
+import time
+import tempfile
+
+import conf
+import ems_util
+
+
+def do_download_sw(sw_info, sw_download_dir):
+    """
+    return err, reason, file_location_in_nes
+    """
+
+    sw_location = sw_info['swLocation']
+
+    # Use copy file from SW_SERVER_SIMULATOR to simulate download file
+    sw_file_name = sw_location.split('/')[-1]
+
+    file_location_in_server = conf.SW_SERVER_SIMULATOR + '/' + sw_file_name
+    file_location_in_ne = sw_download_dir + '/' + sw_file_name
+
+    try:
+        shutil.copy(file_location_in_server, sw_download_dir)
+    except IOError as e:
+        return True, "Download %s to %s error: %s" % (sw_file_name, sw_download_dir, str(e)), file_location_in_ne
+
+    return False, None, file_location_in_ne
+
+
+def generate_notification(download_process_id, download_status, downloaded_ne_sw_info, failed_sw_info):
+    notification = {
+        "objectClass": "EMSClass",
+        "objectInstance": "EMSInstance",
+        "notificationId": random.randint(1, conf.MAX_INT),
+        "eventTime": time.asctime(),
+        "systemDN": "emssimulator",
+        "notificationType": "notifyDownloadNESwStatusChanged",
+        "downloadProcessId": download_process_id,
+        "downloadOperationStatus": download_status
+    }
+
+    if downloaded_ne_sw_info:
+        notification["downloadedNESwInfo"] = downloaded_ne_sw_info
+
+    if failed_sw_info:
+        notification["failedSwInfo"] = failed_sw_info
+
+    return notification
+
+
+def download_ne_sw(sw_to_be_downloaded, ne_id):
+    ne_info = ems_util.get_ne_info_from_db_by_id(ne_id)
+
+    download_process_id = random.randint(1, conf.MAX_INT)
+    result = conf.REQ_SUCCESS
+    ret_value = {
+        "downloadProcessId": download_process_id,
+        "result": result
+    }
+
+    if not ne_info:
+        ret_value["result"] = conf.REQ_FAILURE
+        ret_value["reason"] = "Can not find NE %s" % ne_id
+        return ret_value
+
+    ne_info["status"] = conf.STATUS_DOWNLOADING
+    ems_util.update_ne_info(ne_info)
+
+    num_sw_to_be_downloaded = len(sw_to_be_downloaded)
+
+    downloaded_ne_sw_info = []
+    failed_sw_info = []
+
+    sw_download_parent_dir = conf.PNF_SIMULATORS_DIR + '/' + ne_info['omIP'] + conf.PNF_SW_DOWNLOAD_DIR
+    sw_download_dir = ne_info.get("downloadedSwLocation", "")
+    try:
+        if not os.path.isdir(sw_download_parent_dir):
+            os.makedirs(sw_download_parent_dir)
+
+        if sw_download_dir and not os.path.isdir(sw_download_dir):
+            os.makedirs(sw_download_dir)
+    except OSError as e:
+        ret_value["result"] = conf.REQ_FAILURE
+        ret_value["reason"] = str(e)
+        return ret_value
+
+    if not sw_download_dir:
+        sw_download_dir = tempfile.mkdtemp(dir=sw_download_parent_dir)
+
+    for sw_info in sw_to_be_downloaded:
+        err, reason, file_location = do_download_sw(sw_info, sw_download_dir)
+        if not err:
+            downloaded_ne_sw_info.append(file_location)
+        else:
+            result = conf.REQ_FAILURE
+            failed_sw_entry = {
+                "failedSw": file_location,
+                "failureReason": reason
+            }
+            failed_sw_info.append(failed_sw_entry)
+
+    num_downloaded_ne_sw = len(downloaded_ne_sw_info)
+
+    if num_downloaded_ne_sw == num_sw_to_be_downloaded:
+        download_status = "NE_SWDOWNLOAD_SUCCESSFUL"
+    elif num_downloaded_ne_sw == 0:
+        download_status = "NE_SWDOWNLOAD_FAILED"
+    else:
+        download_status = "NE_SWDOWNLOAD_PARTIALLY_SUCCESSFUL"
+
+    notification = generate_notification(download_process_id, download_status, downloaded_ne_sw_info, failed_sw_info)
+    ems_util.send_notification(notification, download_process_id)
+
+    if result == conf.REQ_SUCCESS:
+        ne_info["downloadedSwLocation"] = sw_download_dir
+        ems_util.update_ne_info(ne_info)
+    else:
+        shutil.rmtree(sw_download_dir, ignore_errors=True)
+
+        ret_value["result"] = result
+        ret_value["reason"] = json.dumps(failed_sw_info)
+
+    # for automated software management, there is no listOfStepNumbersAndDurations
+    return ret_value
+
+
+def main():
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument("--swToBeDownloaded", help="The NE software to be downloaded", required=True)
+    parser.add_argument("--neIdentifier", help="The NE where the software can be downloaded", required=True)
+
+    args = parser.parse_args()
+
+    sw_to_be_downloaded = json.loads(args.swToBeDownloaded)
+
+    ret_value = download_ne_sw(sw_to_be_downloaded, args.neIdentifier)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.REQ_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/test/mocks/emssimulator/swm/ems_db/ne_info_table.json b/test/mocks/emssimulator/swm/ems_db/ne_info_table.json
new file mode 100644
index 0000000..90aaeb2
--- /dev/null
+++ b/test/mocks/emssimulator/swm/ems_db/ne_info_table.json
@@ -0,0 +1,41 @@
+[
+  {
+    "status": "Activated", 
+    "nEIdentification": "5gDU0001", 
+    "updateTime": "Tue Apr 23 13:08:43 2019", 
+    "omIP": "192.168.1.1", 
+    "currentSwVersion": "v1", 
+    "installedSw": {
+      "ran_du_pkg2-v1": {
+        "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2", 
+        "version": "v1", 
+        "name": "ran_du_pkg2"
+      }, 
+      "ran_du_pkg1-v1": {
+        "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1", 
+        "version": "v1", 
+        "name": "ran_du_pkg1"
+      }
+    }
+  }, 
+  {
+    "status": "Activated", 
+    "nEIdentification": "5gDU0002", 
+    "updateTime": "Tue Apr 23 11:06:36 2019", 
+    "omIP": "192.168.1.2", 
+    "oldSwVersion": "v1", 
+    "currentSwVersion": "v2", 
+    "installedSw": {
+      "ran_du_pkg1-v2": {
+        "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1", 
+        "version": "v2", 
+        "name": "ran_du_pkg1"
+      }, 
+      "ran_du_pkg2-v2": {
+        "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2", 
+        "version": "v2", 
+        "name": "ran_du_pkg2"
+      }
+    }
+  }
+]
diff --git a/test/mocks/emssimulator/swm/ems_util.py b/test/mocks/emssimulator/swm/ems_util.py
new file mode 100644
index 0000000..6d0d310
--- /dev/null
+++ b/test/mocks/emssimulator/swm/ems_util.py
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+
+import time
+import json
+import jsonpath
+
+import conf
+
+
+def get_ne_info_list_from_db(ne_filter):
+    with open(conf.NE_INFO_TABLE) as f_ne_info:
+        ne_info_table = json.load(f_ne_info)
+
+    if ne_info_table:
+        ne_info_list = jsonpath.jsonpath(ne_info_table, ne_filter)
+        return ne_info_list if ne_info_list else []
+    else:
+        return []
+
+
+def get_ne_info_from_db_by_id(ne_id):
+    ne_filter = '$..[?(@.nEIdentification == "%s")]' % ne_id
+
+    ne_info_list = get_ne_info_list_from_db(ne_filter)
+
+    return ne_info_list[0] if ne_info_list else None
+
+
+def update_ne_info(ne_info):
+    with open(conf.NE_INFO_TABLE) as f_ne_info:
+        ne_info_table = json.load(f_ne_info)
+
+    ne_info["updateTime"] = time.asctime()
+
+    if ne_info_table:
+        for i in range(0, len(ne_info_table)):
+            if ne_info_table[i]["nEIdentification"] == ne_info["nEIdentification"]:
+                ne_info_table[i] = ne_info
+                break
+        else:
+            ne_info_table.append(ne_info)
+    else:
+        ne_info_table = [ne_info]
+
+    with open(conf.NE_INFO_TABLE, 'w') as f_ne_info:
+        json.dump(ne_info_table, f_ne_info, indent=2)
+
+
+def send_notification(notification, process_id):
+    notification_file = conf.NOTIFICATION_DIR + '/%s-%d' % (notification['notificationType'], process_id)
+
+    with open(notification_file, 'w') as f_notification:
+        f_notification.write(json.dumps(notification))
diff --git a/test/mocks/emssimulator/swm/installNESw b/test/mocks/emssimulator/swm/installNESw
new file mode 100755
index 0000000..84e2fb9
--- /dev/null
+++ b/test/mocks/emssimulator/swm/installNESw
@@ -0,0 +1,206 @@
+#!/usr/bin/python
+
+import sys
+import argparse
+import json
+import os
+import shutil
+import random
+import time
+import tempfile
+import zipfile
+
+import conf
+import ems_util
+
+
+def do_install_sw(sw_to_be_installed, ne_info):
+    """
+    return err, reason, installed_ne_sw
+    """
+
+    sw_install_dir_in_ne = conf.PNF_SIMULATORS_DIR + '/' + ne_info['omIP'] + conf.PNF_SW_INSTALL_DIR
+
+    if sw_to_be_installed.startswith('/'):
+        file_location = sw_to_be_installed
+    else:
+        sw_download_dir_in_ne = ne_info.get("downloadedSwLocation", "")
+        file_location = sw_download_dir_in_ne + '/' + sw_to_be_installed
+
+    if not os.access(file_location, os.R_OK):
+        return True, "Missing to be installed SW file %s" % file_location, None
+
+    try:
+        if not os.path.isdir(sw_install_dir_in_ne):
+            os.makedirs(sw_install_dir_in_ne)
+    except OSError as e:
+        return True, str(e), None
+
+    temp_dir = tempfile.mkdtemp(dir=sw_install_dir_in_ne)
+    if file_location.endswith(".zip"):
+        with zipfile.ZipFile(file_location) as sw_zip:
+            sw_zip.extractall(temp_dir)
+    else:
+        return True, "Only support zip file", None
+
+    manifest_location = temp_dir + '/' + conf.MANIFEST_FILE
+    if os.access(manifest_location, os.R_OK):
+        with open(manifest_location) as f_manifest:
+            manifest = json.load(f_manifest)
+    else:
+        shutil.rmtree(temp_dir, ignore_errors=True)
+        return True, "Missing manifest file in %s" % file_location, None
+
+    try:
+        target_sw_name = manifest["name"]
+        target_sw_version = manifest["version"]
+    except KeyError as e:
+        shutil.rmtree(temp_dir, ignore_errors=True)
+        return True, "Missing key %s in %s of %s" % (str(e), conf.MANIFEST_FILE, file_location), None
+
+    if "targetSwVersion" in ne_info and ne_info["targetSwVersion"] != target_sw_version:
+        shutil.rmtree(temp_dir, ignore_errors=True)
+        return True, "Conflicted targetVersion for %s" % file_location, None
+
+    ne_info["targetSwVersion"] = target_sw_version
+    ems_util.update_ne_info(ne_info)
+
+    target_sw_parent_dir = sw_install_dir_in_ne + '/' + target_sw_version
+    try:
+        if not os.path.isdir(target_sw_parent_dir):
+            os.makedirs(target_sw_parent_dir)
+    except OSError as e:
+        shutil.rmtree(temp_dir, ignore_errors=True)
+        return True, str(e), None
+
+    target_sw_dir = target_sw_parent_dir + '/' + target_sw_name
+    if os.path.isdir(target_sw_dir):
+        shutil.rmtree(target_sw_dir, ignore_errors=True)
+
+    try:
+        shutil.move(temp_dir, target_sw_dir)
+    except shutil.Error as e:
+        shutil.rmtree(temp_dir, ignore_errors=True)
+        return True, str(e), None
+
+    installed_ne_sw = target_sw_name + '-' + target_sw_version
+
+    installed_sw_db = target_sw_parent_dir + '/' + conf.INSTALLED_SW
+    if os.path.isfile(installed_sw_db):
+        with open(installed_sw_db) as f_installed_sw:
+            installed_sw_table = json.load(f_installed_sw)
+        if not installed_sw_table:
+            installed_sw_table = {}
+    else:
+        installed_sw_table = {}
+
+    target_sw_info = {
+        "name": target_sw_name,
+        "version": target_sw_version,
+        "installedLocation": target_sw_dir
+    }
+    installed_sw_table[installed_ne_sw] = target_sw_info
+
+    with open(installed_sw_db, 'w') as f_installed_sw:
+        json.dump(installed_sw_table, f_installed_sw, indent=2)
+
+    ne_info["installedSw"] = installed_sw_table
+
+    return False, None, installed_ne_sw
+
+
+def generate_notification(install_process_id, install_status, installed_ne_sw_info, failed_sw_info):
+    notification = {
+        "objectClass": "EMSClass",
+        "objectInstance": "EMSInstance",
+        "notificationId": random.randint(1, conf.MAX_INT),
+        "eventTime": time.asctime(),
+        "systemDN": "emssimulator",
+        "notificationType": "notifyInstallNESwStatusChanged",
+        "installProcessId": install_process_id,
+        "installOperationStatus": install_status
+    }
+
+    if installed_ne_sw_info:
+        notification["installedNESwInfo"] = installed_ne_sw_info
+
+    if failed_sw_info:
+        notification["failedSwInfo"] = failed_sw_info
+
+    return notification
+
+
+def install_ne_sw(sw_to_be_installed, ne_id):
+    ne_info = ems_util.get_ne_info_from_db_by_id(ne_id)
+
+    install_process_id = random.randint(1, conf.MAX_INT)
+    result = conf.REQ_SUCCESS
+    ret_value = {
+        "installProcessId": install_process_id,
+        "result": result
+    }
+
+    if not ne_info:
+        ret_value["result"] = conf.REQ_FAILURE
+        ret_value["reason"] = "Can not find NE %s" % ne_id
+        return ret_value
+
+    ne_info["status"] = conf.STATUS_INSTALLING
+    ems_util.update_ne_info(ne_info)
+
+    installed_ne_sw_info = []
+    failed_sw_info = []
+
+    err, reason, installed_ne_sw = do_install_sw(sw_to_be_installed, ne_info)
+
+    if not err:
+        installed_ne_sw_info.append(installed_ne_sw)
+    else:
+        result = conf.REQ_FAILURE
+        failed_sw_entry = {
+            "failedSw": installed_ne_sw,
+            "failureReason": reason
+        }
+        failed_sw_info.append(failed_sw_entry)
+
+    num_installed_ne_sw = len(installed_ne_sw_info)
+
+    if num_installed_ne_sw == 1:
+        install_status = "NE_SWINSTALLATION_SUCCESSFUL"
+    elif num_installed_ne_sw == 0:
+        install_status = "NE_SWINSTALLATION_FAILED"
+    else:
+        install_status = "NE_SWINSTALLATION_PARTIALLY_SUCCESSFUL"
+
+    notification = generate_notification(install_process_id, install_status, installed_ne_sw_info, failed_sw_info)
+    ems_util.send_notification(notification, install_process_id)
+
+    if result == conf.REQ_SUCCESS:
+        ems_util.update_ne_info(ne_info)
+    else:
+        ret_value["result"] = result
+        ret_value["reason"] = json.dumps(failed_sw_info)
+
+    # for automated software management, there is no listOfStepNumbersAndDurations
+    return ret_value
+
+
+def main():
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument("--swToBeInstalled", help="The NE software to be installed", required=True)
+    parser.add_argument("--neIdentifier", help="The NE where the software can be installed", required=True)
+
+    args = parser.parse_args()
+
+    ret_value = install_ne_sw(args.swToBeInstalled, args.neIdentifier)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.REQ_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/current b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/current
new file mode 120000
index 0000000..28c218c
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/current
@@ -0,0 +1 @@
+v1
\ No newline at end of file
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/installed_sw.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/installed_sw.json
new file mode 100644
index 0000000..9c19215
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/installed_sw.json
@@ -0,0 +1,12 @@
+{
+  "ran_du_pkg2-v1": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2", 
+    "version": "v1", 
+    "name": "ran_du_pkg2"
+  }, 
+  "ran_du_pkg1-v1": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1", 
+    "version": "v1", 
+    "name": "ran_du_pkg1"
+  }
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/app1 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/manifest.json
new file mode 100644
index 0000000..dd19981
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg1/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/app2 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/manifest.json
new file mode 100644
index 0000000..9bc88f5
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.1/opt/install/v1/ran_du_pkg2/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/current b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/current
new file mode 120000
index 0000000..8494ac2
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/current
@@ -0,0 +1 @@
+v2
\ No newline at end of file
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/installed_sw.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/installed_sw.json
new file mode 100644
index 0000000..31cddf9
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/installed_sw.json
@@ -0,0 +1,12 @@
+{
+  "ran_du_pkg2-v1": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2", 
+    "version": "v1", 
+    "name": "ran_du_pkg2"
+  }, 
+  "ran_du_pkg1-v1": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1", 
+    "version": "v1", 
+    "name": "ran_du_pkg1"
+  }
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/app1 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/manifest.json
new file mode 100644
index 0000000..dd19981
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg1/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/app2 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/manifest.json
new file mode 100644
index 0000000..9bc88f5
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v1/ran_du_pkg2/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/installed_sw.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/installed_sw.json
new file mode 100644
index 0000000..e55c7f5
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/installed_sw.json
@@ -0,0 +1,12 @@
+{
+  "ran_du_pkg1-v2": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1", 
+    "version": "v2", 
+    "name": "ran_du_pkg1"
+  }, 
+  "ran_du_pkg2-v2": {
+    "installedLocation": "/home/ubuntu/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2", 
+    "version": "v2", 
+    "name": "ran_du_pkg2"
+  }
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/app1 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/manifest.json
new file mode 100644
index 0000000..a3e7d05
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg1/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v2"
+}
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/app2 b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/manifest.json b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/manifest.json
new file mode 100644
index 0000000..fe9ffe0
--- /dev/null
+++ b/test/mocks/emssimulator/swm/pnf_simulators/192.168.1.2/opt/install/v2/ran_du_pkg2/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v2"
+}
diff --git a/test/mocks/emssimulator/swm/swFallback b/test/mocks/emssimulator/swm/swFallback
new file mode 100755
index 0000000..9d6608c
--- /dev/null
+++ b/test/mocks/emssimulator/swm/swFallback
@@ -0,0 +1,127 @@
+#!/usr/bin/python
+
+import argparse
+import json
+import sys
+import os
+import shutil
+
+import conf
+import ems_util
+
+
+def sw_fallback(ne_info_list):
+    ne_list = []
+    num_failure = 0
+
+    for ne_info in ne_info_list:
+        if ne_info.get("status") == conf.STATUS_DOWNLOADING:
+            ne_info["status"] = conf.STATUS_ACTIVATED
+            ems_util.update_ne_info(ne_info)
+
+            ne_entry = {
+                "nEIdentification": ne_info["nEIdentification"],
+                "swFallbackStatus": "fallbackSuccessful"
+            }
+            ne_list.append(ne_entry)
+            continue
+
+        sw_install_dir_in_ne = conf.PNF_SIMULATORS_DIR + '/' + ne_info['omIP'] + conf.PNF_SW_INSTALL_DIR
+
+        if ne_info.get("status") == conf.STATUS_INSTALLING:
+            old_sw_version = ne_info.get("currentSwVersion", "")
+            current_sw_version = ne_info.get("targetSwVersion", "")
+        else:
+            old_sw_version = ne_info.get("oldSwVersion", "")
+            current_sw_version = ne_info.get("currentSwVersion", "")
+
+        old_sw_dir = sw_install_dir_in_ne + '/' + old_sw_version
+
+        if not old_sw_version or not os.path.isdir(old_sw_dir):
+            ne_entry = {
+                "nEIdentification": ne_info["nEIdentification"],
+                "swFallbackStatus": "fallbackUnsuccessful"
+            }
+            ne_list.append(ne_entry)
+
+            num_failure += 1
+            continue
+
+        current_sw_dir = sw_install_dir_in_ne + '/' + current_sw_version
+
+        if current_sw_version and os.path.isdir(current_sw_dir) and current_sw_dir != old_sw_dir:
+            shutil.rmtree(current_sw_dir, ignore_errors=True)
+
+        old_cwd = os.getcwd()
+        os.chdir(sw_install_dir_in_ne)
+        if os.path.islink(conf.CURRENT_VERSION_DIR):
+            os.remove(conf.CURRENT_VERSION_DIR)
+        os.symlink(old_sw_version, conf.CURRENT_VERSION_DIR)
+        os.chdir(old_cwd)
+
+        installed_sw_db = old_sw_dir + '/' + conf.INSTALLED_SW
+        if os.path.isfile(installed_sw_db):
+            with open(installed_sw_db) as f_installed_sw:
+                installed_sw_table = json.load(f_installed_sw)
+            if not installed_sw_table:
+                installed_sw_table = {}
+        else:
+            installed_sw_table = {}
+
+        ne_info["installedSw"] = installed_sw_table
+        if "oldSwVersion" in ne_info:
+            ne_info["currentSwVersion"] = ne_info["oldSwVersion"]
+            del ne_info["oldSwVersion"]
+
+        if "targetSwVersion" in ne_info:
+            del ne_info["targetSwVersion"]
+
+        if "downloadedSwLocation" in ne_info:
+            if os.path.isdir(ne_info["downloadedSwLocation"]):
+                shutil.rmtree(ne_info["downloadedSwLocation"], ignore_errors=True)
+            del ne_info["downloadedSwLocation"]
+
+        ne_info["status"] = conf.STATUS_ACTIVATED
+        ems_util.update_ne_info(ne_info)
+
+        ne_entry = {
+            "nEIdentification": ne_info["nEIdentification"],
+            "swFallbackStatus": "fallbackSuccessful"
+        }
+        ne_list.append(ne_entry)
+
+    if num_failure == 0:
+        result = conf.RESULT_SUCCESS
+    elif num_failure == len(ne_info_list):
+        result = conf.RESULT_FAILURE
+    else:
+        result = conf.RESULT_PARTLY
+
+    ret_value = {
+        "nEList": ne_list,
+        "result": result
+    }
+
+    return ret_value
+
+
+def main():
+    parser = argparse.ArgumentParser()
+
+    parser.add_argument("--filter", help="To describe properties of the NEs to be selected", required=True)
+
+    args = parser.parse_args()
+
+    ne_info_list = ems_util.get_ne_info_list_from_db(args.filter)
+
+    ret_value = sw_fallback(ne_info_list)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.RESULT_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/app1 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/manifest.json
new file mode 100644
index 0000000..dd19981
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v1/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/app1 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/manifest.json
new file mode 100644
index 0000000..a3e7d05
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v2/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v2"
+}
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/app1 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/app1
new file mode 100644
index 0000000..9df42f7
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/app1
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app1"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/manifest.json
new file mode 100644
index 0000000..37ec87c
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg1-v3/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg1",
+  "version": "v3"
+}
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/app2 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/manifest.json
new file mode 100644
index 0000000..9bc88f5
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v1/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v1"
+}
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/app2 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/manifest.json
new file mode 100644
index 0000000..fe9ffe0
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v2/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v2"
+}
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/app2 b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/app2
new file mode 100644
index 0000000..e74b365
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/app2
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+echo "app2"
+
diff --git a/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/manifest.json b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/manifest.json
new file mode 100644
index 0000000..f0af8bc
--- /dev/null
+++ b/test/mocks/emssimulator/swm/sw_server_simulator/ran_du_pkg2-v3/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "ran_du_pkg2",
+  "version": "v3"
+}
diff --git a/test/mocks/emssimulator/swm/upgrade-post-check b/test/mocks/emssimulator/swm/upgrade-post-check
new file mode 100755
index 0000000..799afbc
--- /dev/null
+++ b/test/mocks/emssimulator/swm/upgrade-post-check
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+import sys
+import json
+
+import conf
+import ems_util
+
+
+def upgrade_postcheck(pnf_id, old_sw_version, target_sw_version, rule_name, tmp_file=None):
+    ne_info = ems_util.get_ne_info_from_db_by_id(pnf_id)
+
+    if not ne_info:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Can not find NE %s" % pnf_id
+        }
+        return ret_value
+
+    old_sw_version_in_db = ne_info.get("oldSwVersion", "")
+    current_sw_version_in_db = ne_info.get("currentSwVersion", "")
+
+    if old_sw_version != old_sw_version_in_db:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Old SW version %s in PNF is not matched with oldSwVersion %s" %
+                      (old_sw_version_in_db, old_sw_version)
+        }
+        return ret_value
+
+    if target_sw_version != current_sw_version_in_db:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Current SW version %s in PNF is not matched with targetSwVersion %s" %
+                      (current_sw_version_in_db, target_sw_version)
+        }
+        return ret_value
+
+    ne_info["checkStatus"] = conf.STATUS_POSTCHECKED
+    ems_util.update_ne_info(ne_info)
+
+    ret_value = {
+         "result": conf.RESULT_SUCCESS
+    }
+
+    return ret_value
+
+
+def main():
+    #  {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+
+    if len(sys.argv) < 5:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Missing parameters"
+        }
+        print json.dumps(ret_value)
+        sys.exit(conf.RET_CODE_FAILURE)
+
+    if len(sys.argv) >= 5:
+        pnf_id = sys.argv[1]
+        old_sw_version = sys.argv[2]
+        target_sw_version = sys.argv[3]
+        rule_name = sys.argv[4]
+        tmp_file = None
+
+    if len(sys.argv) >= 6:
+        tmp_file = sys.argv[5]
+
+    ret_value = upgrade_postcheck(pnf_id, old_sw_version, target_sw_version, rule_name, tmp_file)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.RESULT_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
diff --git a/test/mocks/emssimulator/swm/upgrade-pre-check b/test/mocks/emssimulator/swm/upgrade-pre-check
new file mode 100755
index 0000000..6bf867f
--- /dev/null
+++ b/test/mocks/emssimulator/swm/upgrade-pre-check
@@ -0,0 +1,71 @@
+#!/usr/bin/python
+
+import sys
+import json
+
+import conf
+import ems_util
+
+
+def upgrade_precheck(pnf_id, old_sw_version, target_sw_version, rule_name, tmp_file=None):
+    ne_info = ems_util.get_ne_info_from_db_by_id(pnf_id)
+
+    if not ne_info:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Can not find NE %s" % pnf_id
+        }
+        return ret_value
+
+    current_sw_version_in_db = ne_info.get("currentSwVersion", "")
+
+    if old_sw_version != current_sw_version_in_db:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Current SW version %s in PNF is not matched with oldSwVersion %s" %
+                      (current_sw_version_in_db, old_sw_version)
+        }
+        return ret_value
+
+    ne_info["checkStatus"] = conf.STATUS_PRECHECKED
+    ems_util.update_ne_info(ne_info)
+
+    ret_value = {
+         "result": conf.RESULT_SUCCESS
+    }
+
+    return ret_value
+
+
+def main():
+    #  {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+
+    if len(sys.argv) < 5:
+        ret_value = {
+            "result": conf.RESULT_FAILURE,
+            "reason": "Missing parameters"
+        }
+        print json.dumps(ret_value)
+        sys.exit(conf.RET_CODE_FAILURE)
+
+    if len(sys.argv) >= 5:
+        pnf_id = sys.argv[1]
+        old_sw_version = sys.argv[2]
+        target_sw_version = sys.argv[3]
+        rule_name = sys.argv[4]
+        tmp_file = None
+
+    if len(sys.argv) >= 6:
+        tmp_file = sys.argv[5]
+
+    ret_value = upgrade_precheck(pnf_id, old_sw_version, target_sw_version, rule_name, tmp_file)
+    print json.dumps(ret_value)
+
+    if ret_value["result"] == conf.RESULT_SUCCESS:
+        sys.exit(conf.RET_CODE_SUCCESS)
+    else:
+        sys.exit(conf.RET_CODE_FAILURE)
+
+
+if __name__ == '__main__':
+    main()
