Support identifying different tgz files based on run_label attribute

tgz files in trials can be categorized in subdirectories, allowing to
select different bianry files at runtime based on the target run node
which is going to run them. This way for instance one can have a binary
linked against libs for eg. CentOS under run_label "centos/" or an ARM
target under "arm", and then use "run_label: arm" on the resource using
it.

Change-Id: Iaf2e97da3aff693395f44f0e93b184d4846cf6da
diff --git a/selftest/trial_test/trial_test.py b/selftest/trial_test/trial_test.py
index a99428a..cf91a85 100755
--- a/selftest/trial_test/trial_test.py
+++ b/selftest/trial_test/trial_test.py
@@ -1,8 +1,10 @@
 #!/usr/bin/env python3
 
-import time
 import _prep
+
+import time
 import os
+
 from osmo_gsm_tester.core import util
 from osmo_gsm_tester.core.trial import Trial
 
@@ -46,4 +48,17 @@
 except RuntimeError as e:
     print('ok, got RuntimeError: %s' % str(e))
 
+print('- Verify trials based on run_label')
+d = util.Dir('trial_test')
+t = Trial(d.child('run_label'))
+t.verify()
+inst = util.Dir(t.get_inst('sample', 'foobar'))
+print('inst: ' + str(inst))
+with open(inst.child('file2'), 'r') as f:
+    print('content file2: %s' % f.read())
+inst = util.Dir( t.get_inst('sample'))
+print('inst: ' + str(inst))
+with open(inst.child('file1'), 'r') as f:
+    print('content file1: %s' % f.read())
+
 # vim: expandtab tabstop=4 shiftwidth=4