Create dir for patches at first step

If directory does not exists base64 decode will fail

PROD-36525

Change-Id: Ib429c7bf07a72be1547e94de8a858fc6d0610cb0
diff --git a/backports/init.sls b/backports/init.sls
index 526d7c2..1c4ee36 100644
--- a/backports/init.sls
+++ b/backports/init.sls
@@ -4,6 +4,13 @@
 
 {% set patch_directory = backports.get('patch_directory','/tmp/patches') %}
 
+{{ patch_directory }}:
+  file.directory:
+    - user: root
+    - group: root
+    - dir_mode: 755
+    - makedirs: True
+
 {% for fix, fix_data in backports.get('patches').iteritems() %}
 {% for patch_source, patch_data in fix_data.iteritems() %}
 {% set patch_filename = patch_directory + "/" + fix + patch_source.replace('/','_') + ".diff" %}
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 29fb975..8f37b0c 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -39,6 +39,7 @@
     log_info "Setting up Python virtualenv"
     virtualenv $VENV_DIR
     source ${VENV_DIR}/bin/activate
+    pip install -r test-requirements.txt
     pip install salt${PIP_SALT_VERSION}
 }
 
@@ -124,8 +125,8 @@
 }
 
 salt_run() {
-    [ -e ${VEN_DIR}/bin/activate ] && source ${VENV_DIR}/bin/activate
-    salt-call ${SALT_OPTS} $*
+    [ -e ${VENV_DIR}/bin/activate ] && source ${VENV_DIR}/bin/activate
+    python $(which salt-call) ${SALT_OPTS} $*
 }
 
 prepare() {
@@ -139,6 +140,7 @@
 }
 
 run() {
+    salt_run grains.append 'ipv4' '0.0.0.0'
     for pillar in ${PILLARDIR}/*.sls; do
         grep ${FORMULA_NAME}: ${pillar} &>/dev/null || continue
         state_name=$(basename ${pillar%.sls})
diff --git a/tests/test-requirements.txt b/tests/test-requirements.txt
new file mode 100644
index 0000000..cf42007
--- /dev/null
+++ b/tests/test-requirements.txt
@@ -0,0 +1 @@
+msgpack<1.0.0