[Reproducible-commits] [reprotest] 03/04: Rename Testbed.caps to Testbed.capabilities

Ceridwen ceridwen-guest at moszumanska.debian.org
Thu Jul 21 20:18:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

ceridwen-guest pushed a commit to branch virtualization
in repository reprotest.

commit 585a116e487fe606496ec3d37e0e6e02b0288e94
Author: Ceridwen <ceridwenv at gmail.com>
Date:   Thu Jul 21 16:17:27 2016 -0400

    Rename Testbed.caps to Testbed.capabilities
---
 reprotest/lib/adt_testbed.py | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/reprotest/lib/adt_testbed.py b/reprotest/lib/adt_testbed.py
index ce0d7ee..c80e7c4 100644
--- a/reprotest/lib/adt_testbed.py
+++ b/reprotest/lib/adt_testbed.py
@@ -123,7 +123,7 @@ class Testbed:
 
         # provide autopkgtest-reboot command, if reboot is supported; /run is
         # usually "noexec" and /[s]bin might be readonly, so create in /tmp
-        if 'reboot' in self.caps and 'root-on-testbed' in self.caps:
+        if 'reboot' in self.capabilities and 'root-on-testbed' in self.capabilities:
             adtlog.debug('testbed supports reboot, creating /tmp/autopkgtest-reboot')
             self.execute(['sh', '-ecC', '''[ ! -e /tmp/autopkgtest-reboot ] || exit 0; '''
                           '''/bin/echo -e '#!/bin/sh -e\\n'''
@@ -178,16 +178,16 @@ class Testbed:
         self.apt_pin_for_pockets = []
         self.recommends_installed = False
         self.exec_cmd = list(map(urllib.parse.unquote, self.command('print-execute-command', (), 1)[0].split(',')))
-        self.caps = self.command('capabilities', (), None)
-        adtlog.debug('testbed capabilities: %s' % self.caps)
-        for c in self.caps:
+        self.capabilities = self.command('capabilities', (), None)
+        adtlog.debug('testbed capabilities: %s' % self.capabilities)
+        for c in self.capabilities:
             if c.startswith('downtmp-host='):
                 self.shared_downtmp = c.split('=', 1)[1]
 
         # provide a default for --user
-        if self.user is None and 'root-on-testbed' in self.caps:
+        if self.user is None and 'root-on-testbed' in self.capabilities:
             self.user = ''
-            for c in self.caps:
+            for c in self.capabilities:
                 if c.startswith('suggested-normal-user='):
                     self.user = c.split('=', 1)[1]
 
@@ -269,7 +269,7 @@ class Testbed:
                 self.bomb('testbed setup commands failed with status %i' % rc)
 
         # if the setup commands affected the boot, then reboot
-        if self.setup_commands and 'reboot' in self.caps:
+        if self.setup_commands and 'reboot' in self.capabilities:
             boot_affected = self.execute(
                 ['bash', '-ec', '[ ! -e /run/autopkgtest_no_reboot.stamp ] || exit 0;'
                  'for d in %s; do s=%s/${d//\//_}.stamp;'
@@ -285,7 +285,7 @@ class Testbed:
         adtlog.debug('testbed reset: modified=%s, deps_installed=%s(r: %s), deps_new=%s(r: %s)' %
                      (self.modified, self.deps_installed, self.recommends_installed,
                       deps_new, with_recommends))
-        if 'revert' in self.caps and (
+        if 'revert' in self.capabilities and (
                 self.modified or self.recommends_installed != with_recommends or
                 [d for d in self.deps_installed if d not in deps_new]):
             adtlog.debug('testbed reset')
@@ -734,7 +734,7 @@ fi
         if 'ADT_CLICK_NO_FRAMEWORK_CHECK' in os.environ:
             # this is mostly for testing
             clickopts.append('--force-missing-framework')
-        if 'root-on-testbed' in self.caps:
+        if 'root-on-testbed' in self.capabilities:
             rc = self.execute(['click', 'install', '--allow-unauthenticated'] +
                               clickopts + [tp.tb], kind='install')[0]
         else:
@@ -767,7 +767,7 @@ fi
             return False
         adtlog.debug('testbed has AppArmor/click')
 
-        if 'root-on-testbed' not in self.caps:
+        if 'root-on-testbed' not in self.capabilities:
             adtlog.warning('Cannot adjust AppArmor rules without root/sudo '
                            'privileges; Autopilot tests will fail and test '
                            'dependencies will not be available!')
@@ -855,7 +855,7 @@ fi
 
         # check if we can use apt-get
         can_apt_get = False
-        if 'root-on-testbed' in self.caps:
+        if 'root-on-testbed' in self.capabilities:
             rc = self.execute(['test', '-w', '/var/lib/dpkg/status'])[0]
             if rc == 0:
                 can_apt_get = True
@@ -962,7 +962,7 @@ fi
                   % {'t': test_cmd, 'o': so.tb, 'e': se.tb}
 
         if 'needs-root' not in test.restrictions and self.user is not None:
-            if 'root-on-testbed' not in self.caps:
+            if 'root-on-testbed' not in self.capabilities:
                 self.bomb('cannot change to user %s without root-on-testbed' % self.user,
                           adtlog.AutopkgtestError)
             # we don't want -l here which resets the environment from
@@ -976,7 +976,7 @@ fi
             # this ensures that we have a PAM/logind session for root tests as
             # well; with some interfaces like ttyS1 or lxc_attach we don't log
             # in to the testbed
-            if 'root-on-testbed' in self.caps:
+            if 'root-on-testbed' in self.capabilities:
                 test_argv = ['su', '-s', '/bin/bash', 'root', '-c']
             else:
                 test_argv = ['bash', '-c']
@@ -1002,7 +1002,7 @@ fi
                 break
 
             # did the test invoke autopkgtest-reboot?
-            if os.WIFSIGNALED(rc) and os.WTERMSIG(rc) == signal.SIGKILL and 'reboot' in self.caps:
+            if os.WIFSIGNALED(rc) and os.WTERMSIG(rc) == signal.SIGKILL and 'reboot' in self.capabilities:
                 adtlog.debug('test process SIGKILLed, checking for reboot marker')
                 (code, reboot_marker, err) = self.execute(
                     ['cat', '/run/autopkgtest-reboot-mark'],

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list