summaryrefslogtreecommitdiff
path: root/tests/data/ext/sample_ext-1.2.0
diff options
context:
space:
mode:
authorƁukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>2017-05-18 19:58:02 +0200
committerusd-importer <ubuntu-server@lists.ubuntu.com>2017-05-31 09:53:12 +0000
commit4fb0b5a09b26135ade285844da5d7dfe582a8d4c (patch)
tree09b1e5867d6e7501118cdd0af0012b51fc216530 /tests/data/ext/sample_ext-1.2.0
parent473ad6fbfe0b9c3b362b530492928303f2b4c7f3 (diff)
downloadvyos-walinuxagent-4fb0b5a09b26135ade285844da5d7dfe582a8d4c.tar.gz
vyos-walinuxagent-4fb0b5a09b26135ade285844da5d7dfe582a8d4c.zip
Import patches-unapplied version 2.2.12-0ubuntu1 to ubuntu/artful-proposed
Imported using git-ubuntu import. Changelog parent: 473ad6fbfe0b9c3b362b530492928303f2b4c7f3 New changelog entries: * New upstream release (LP: #1690854). - Refreshed debian/patches/disable_import_test.patch.
Diffstat (limited to 'tests/data/ext/sample_ext-1.2.0')
-rw-r--r--tests/data/ext/sample_ext-1.2.0/HandlerManifest.json14
-rwxr-xr-xtests/data/ext/sample_ext-1.2.0/sample.py37
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/data/ext/sample_ext-1.2.0/HandlerManifest.json b/tests/data/ext/sample_ext-1.2.0/HandlerManifest.json
new file mode 100644
index 0000000..9890d0c
--- /dev/null
+++ b/tests/data/ext/sample_ext-1.2.0/HandlerManifest.json
@@ -0,0 +1,14 @@
+[{
+ "name": "ExampleHandlerLinux",
+ "version": 1.0,
+ "handlerManifest": {
+ "installCommand": "sample.py -install",
+ "uninstallCommand": "sample.py -uninstall",
+ "updateCommand": "sample.py -update",
+ "enableCommand": "sample.py -enable",
+ "disableCommand": "sample.py -disable",
+ "rebootAfterInstall": false,
+ "reportHeartbeat": false
+ }
+}]
+
diff --git a/tests/data/ext/sample_ext-1.2.0/sample.py b/tests/data/ext/sample_ext-1.2.0/sample.py
new file mode 100755
index 0000000..74bd839
--- /dev/null
+++ b/tests/data/ext/sample_ext-1.2.0/sample.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+import os
+
+
+def get_seq():
+ latest_seq = -1
+ config_dir = os.path.join(os.getcwd(), "config")
+ if os.path.isdir(config_dir):
+ for item in os.listdir(config_dir):
+ item_path = os.path.join(config_dir, item)
+ if os.path.isfile(item_path):
+ separator = item.rfind(".")
+ if separator > 0 and item[separator + 1:] == "settings":
+ sequence = int(item[0: separator])
+ if sequence > latest_seq:
+ latest_seq = sequence
+ return latest_seq
+
+
+succeed_status = """
+[{
+ "status": {
+ "status": "success"
+ }
+}]
+"""
+
+if __name__ == "__main__":
+ seq = get_seq()
+ if seq >= 0:
+ status_path = os.path.join(os.getcwd(), "status")
+ if not os.path.exists(status_path):
+ os.makedirs(status_path)
+ status_file = os.path.join(status_path, "{0}.status".format(seq))
+ with open(status_file, "w+") as status:
+ status.write(succeed_status)