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/src/osmo_gsm_tester/obj/run_node.py b/src/osmo_gsm_tester/obj/run_node.py
index 26c85df..bd502af 100644
--- a/src/osmo_gsm_tester/obj/run_node.py
+++ b/src/osmo_gsm_tester/obj/run_node.py
@@ -26,6 +26,7 @@
         'run_addr': schema.IPV4,
         'ssh_user': schema.STR,
         'ssh_addr': schema.IPV4,
+        'run_label': schema.STR,
         }
     schema.register_resource_schema('run_node', resource_schema)
 
@@ -35,12 +36,13 @@
     T_LOCAL = 'local'
     T_REM_SSH = 'ssh'
 
-    def __init__(self, type=None, run_addr=None, ssh_user=None, ssh_addr=None):
+    def __init__(self, type=None, run_addr=None, ssh_user=None, ssh_addr=None, run_label=None):
         super().__init__(log.C_RUN, 'runnode')
         self._type = type
         self._run_addr = run_addr
         self._ssh_user = ssh_user
         self._ssh_addr = ssh_addr
+        self._run_label = run_label
         if not self._type:
             raise log.Error('run_type not set')
         if not self._run_addr:
@@ -57,7 +59,9 @@
 
     @classmethod
     def from_conf(cls, conf):
-        return cls(conf.get('run_type', None), conf.get('run_addr', None), conf.get('ssh_user', None), conf.get('ssh_addr', None))
+        return cls(conf.get('run_type', None), conf.get('run_addr', None),
+                   conf.get('ssh_user', None), conf.get('ssh_addr', None),
+                   conf.get('run_label', None))
 
     def is_local(self):
         return self._type == RunNode.T_LOCAL
@@ -77,4 +81,7 @@
     def ssh_addr(self):
         return self._ssh_addr
 
+    def run_label(self):
+        return self._run_label
+
 # vim: expandtab tabstop=4 shiftwidth=4