summaryrefslogtreecommitdiffstats
path: root/tests/regress/opkgcl.py
diff options
context:
space:
mode:
authorpixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-01-19 08:51:59 (EST)
committer pixdamix@gmail.com <pixdamix@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2012-01-19 08:51:59 (EST)
commit1d9fe6093125be143fde351305214051afc5ec3b (patch)
tree7ea67010f5573746aad2dc938c5c830e9f358ae8 /tests/regress/opkgcl.py
parente22788697aa6c4765c86e0d569cbe0b0137efeb5 (diff)
testcase displaying the loss of the auto-installed flag
git-svn-id: http://opkg.googlecode.com/svn/trunk@634 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'tests/regress/opkgcl.py')
-rwxr-xr-xtests/regress/opkgcl.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regress/opkgcl.py b/tests/regress/opkgcl.py
index bdd9e1e..47e7dd3 100755
--- a/tests/regress/opkgcl.py
+++ b/tests/regress/opkgcl.py
@@ -43,6 +43,19 @@ def is_installed(pkg_name, version=None):
return False
return True
+def is_autoinstalled(pkg_name):
+ status_path = "{}/usr/lib/opkg/status".format(cfg.offline_root)
+ if not os.path.exists(status_path):
+ return False
+ status_file = open(status_path, "r")
+ status = status_file.read()
+ status_file.close()
+ index_start = status.find("Package: {}".format(pkg_name))
+ if index_start < 0:
+ return False
+ index_end = status.find("\n\n", index_start)
+ return status.find("Auto-Installed: yes", index_start, index_end) >= 0
+
if __name__ == '__main__':
import sys