Merge lp:~zyga/checkbox/device-profiles into lp:checkbox

Proposed by Zygmunt Krynicki
Status: Work in progress
Proposed branch: lp:~zyga/checkbox/device-profiles
Merge into: lp:checkbox
Diff against target: 278 lines (+177/-51)
3 files modified
plainbox/plainbox/impl/integration_tests.py (+106/-44)
plainbox/plainbox/test-data/integration-tests/cpu/scaling_test.json (+11/-7)
plainbox/plainbox/testing_utils/resource.py (+60/-0)
To merge this branch: bzr merge lp:~zyga/checkbox/device-profiles
Reviewer Review Type Date Requested Status
Checkbox Developers Pending
Review via email: mp+149016@code.launchpad.net

Description of the change

This branch (work-in-progress) adds a 'profile' for integration tests. The intent is to run only a subset of integration tests (which basically run checkbox jobs) depending on the class of the current machine.

In practice this still needs to evolve to have a way to specify the right profile (virtualbox, arm, etc)

To post a comment you must log in.
lp:~zyga/checkbox/device-profiles updated
1934. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

1935. By Brendan Donegan

Incremented version number.

1936. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] automatic merge by tarmac"

1937. By Brendan Donegan

Bumped rev to 0.15.4 (0.15.3 is based on rev1930)

1938. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

1939. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1940. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1941. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1942. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1943. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1944. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1945. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1946. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1947. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1948. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1949. By Zygmunt Krynicki

"[r=brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

1950. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1951. By Zygmunt Krynicki

vagrant: propagate exit code from test-in-vagrant.sh

Signed-off-by: Zygmunt Krynicki <email address hidden>

1952. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1953. By Daniel Manrique

Removed stray .moved file

1954. By Daniel Manrique

"[r=jeffmarcom][bug=1131598][author=roadmr] automatic merge by tarmac"

1955. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1956. By Jeff Marcom

"[r=roadmr][bug=1135832][author=jeffmarcom] automatic merge by tarmac"

1957. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

1958. By Daniel Manrique

Merged using udev to categorise network devices, by spineau

1959. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Fix test_submission.py now that the udevadm parser detects devices using ID_MODEL_FROM_DATABASE and ID_VENDOR_FROM_DATABASE."

1960. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1961. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1962. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Set the "only_changes" parameter default value to False in get_script_env()"

1963. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

1964. By Zygmunt Krynicki

docs: add a warning to the front page

1965. By Daniel Manrique

Updated sources-list job to use multiple lists and repositories by brendand

1966. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1967. By Brendan Donegan

New version 0.15.5

1968. By Daniel Manrique

"[r=roadmr,zkrynicki][bug=][author=roadmr] Added checkbox-specific tests for resource program syntax.
"

1969. By Daniel Manrique

"[r=roadmr,zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

1970. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] automatic merge by tarmac"

1971. By Daniel Manrique

Merged ignoring of decode errors in udev_resource, by spineau

1972. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

1973. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

1974. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1975. By Jeff Lane 

"[r=zkrynicki][bug=1149213][author=bladernr] automatic merge by tarmac"

1976. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

1977. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

1978. By Zygmunt Krynicki

"[r=zkrynicki,brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

1979. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

1980. By Sylvain Pineau

"[r=zkrynicki,brendan-donegan][bug=1065064][author=sylvain-pineau] Identify KVM devices as such to avoid reporting them as just CAPTURE devices"

1981. By Zygmunt Krynicki

"[r=sylvain-pineau,roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1982. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1983. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1984. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

1985. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1986. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1987. By Zygmunt Krynicki

"[r=roadmr,sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

1988. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1989. By Brendan Donegan

"[r=zkrynicki][bug=1155325][author=brendan-donegan] automatic merge by tarmac"

1990. By Jeff Marcom

"[r=zkrynicki][bug=][author=jeffmarcom] automatic merge by tarmac"

1991. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1992. By Jeff Marcom

"[r=roadmr][bug=][author=jeffmarcom] automatic merge by tarmac"

1993. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1994. By Jeff Marcom

"[r=zkrynicki][bug=1155686][author=jeffmarcom] automatic merge by tarmac"

1995. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

1996. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] XML exporter: Added support for attachments"

1997. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1998. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

1999. By Zygmunt Krynicki

"[r=roadmr][bug=1157264][author=zkrynicki] automatic merge by tarmac"

2000. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2001. By Brendan Donegan

"[r=zkrynicki][bug=1157615][author=brendan-donegan] automatic merge by tarmac"

2002. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Job Definition: Added support for the environ keys"

2003. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Vagrant Settings: Increase the default SSH timeout to 60s"

2004. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2005. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=sylvain-pineau][bug=][author=roadmr] automatic merge by tarmac"

2006. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2007. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki,cgregan][bug=][author=roadmr] automatic merge by tarmac"

2008. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2009. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Coverage: Exclude tests and vendor module from coverage"

2010. By Daniel Manrique

Bumped changelog version to 0.15.6 and moved entries of changes made after 0.15.5 cutoff

2011. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2012. By Zygmunt Krynicki

"[r=brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2013. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2014. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2015. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2016. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki,sylvain-pineau][bug=][author=roadmr] automatic merge by tarmac"

2017. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2018. By Zygmunt Krynicki

"[r=roadmr,zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2019. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2020. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2021. By Brendan Donegan

Fixed up changelog

2022. By Brendan Donegan

Bumped revision number

2023. By Zygmunt Krynicki

jobs: convert package resource programs to be compatible with plainbox

2024. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

2025. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2026. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2027. By Brendan Donegan

"[r=roadmr][bug=1164566][author=brendan-donegan] automatic merge by tarmac"

2028. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2029. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2030. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=roadmr,zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

2031. By Jeff Lane 

"[r=roadmr][bug=1165215][author=bladernr] automatic merge by tarmac"

2032. By Jeff Marcom

"[r=zkrynicki,bladernr][bug=1164028][author=jeffmarcom] automatic merge by tarmac"

2033. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] exporter: xml: generate output that can be read by checkbox parser."

2034. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2035. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] automatic merge by tarmac"

2036. By Jeff Lane 

"[r=zkrynicki][bug=1167214][author=bladernr] automatic merge by tarmac"

2037. By Zygmunt Krynicki

"[r=roadmr,zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2038. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2039. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2040. By Brendan Donegan

"[r=brendan-donegan][bug=][author=brendan-donegan] automatic merge by tarmac"

2041. By Jeff Lane 

"[r=zkrynicki][bug=1157606][author=bladernr] automatic merge by tarmac"

2042. By Brendan Donegan

Incremented changelog version

2043. By Jeff Lane 

"[r=roadmr][bug=][author=bladernr] automatic merge by tarmac"

2044. By Daniel Manrique

Merged manual PXE and IPMI jobs by Jeff Lane

2045. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2046. By Brendan Donegan

"[r=zkrynicki][bug=1149288][author=brendan-donegan] automatic merge by tarmac"

2047. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Added the Geeks3D GpuTest wrapper and related jobs
"

2048. By Sylvain Pineau

debian/control: Added python3-mock as a build dependency.

2049. By Brendan Donegan

"[r=roadmr][bug=][author=checkbox-dev] automatic merge by tarmac"

2050. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=sylvain-pineau][bug=][author=roadmr] flakes8-suggested fixes for transports code."

2051. By Sylvain Pineau

debian/rules: Clean __pycache__ directory after running scripts unit tests.

2052. By Daniel Manrique

Corrected name of dependency package in job definition

2053. By Daniel Manrique

Two minor fixes to mobilebroadband job and create_connection script

2054. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2055. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2056. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2057. By Po-Hsu Lin

"[r=roadmr][bug=][author=cypressyew] automatic merge by tarmac"

2058. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2059. By Brendan Donegan

"[r=roadmr][bug=][author=brendan-donegan] automatic merge by tarmac"

2060. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2061. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2062. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] A couple of fixes that cropped up during testing of sru, config file, and environment testing."

2063. By Jeff Lane 

"[r=roadmr][bug=][author=bladernr] automatic merge by tarmac"

2064. By Jeff Lane 

"[r=roadmr][bug=1155619][author=bladernr] automatic merge by tarmac"

2065. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] Adds support for specifying http{,s}_proxy in the config file and have the certification transport pick that up."

2066. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] This just adds a bunch of time calls to the vagrant testing scripts, so that we know where our bottlenecks are, and whether any fixes we make are actually making things faster."

2067. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=roadmr][bug=][author=roadmr] .desktop file changes: Terminal=false and using sh -c in Exec command so it can use redirection."

2068. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2069. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] job: Consider any environment variable from the config object, not only those declared in the job's environ."

2070. By Zygmunt Krynicki

"[r=roadmr,apulido][bug=][author=zkrynicki] automatic merge by tarmac"

2071. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2072. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=][author=roadmr] job.py: Removed a redundant "if", and added test for config variables from the environment that aren't declared in a job's environ."

2073. By Daniel Manrique

Added submit to hexr checkbox, by brendand

2074. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=roadmr][bug=][author=roadmr] A plainbox-finished upstart event is emitted when either the server or the desktop auto-started test-runs finish, and a plainbox-ci-mailer autostart job that responds to that event."

2075. By Po-Hsu Lin

"[r=zkrynicki][bug=1172108][author=cypressyew] automatic merge by tarmac"

2076. By Daniel Manrique

Fixed changelog - apologies

2077. By Daniel Manrique

Reverted revno 2073 since it contains extraneous files

2078. By Brendan Donegan

"[r=roadmr][bug=][author=brendan-donegan] automatic merge by tarmac"

2079. By Brendan Donegan

Increment major version, tag rev2074 as 0.15.10 and include changes after that in new version entry in debian/changelog

2080. By Daniel Manrique

Merged suspend log after-the-fact checking by Jeff Lane

2081. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2082. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2083. By Daniel Manrique <Daniel Manrique <email address hidden>>

"[r=zkrynicki][bug=1059544][author=roadmr] Replaces alsasrc with autoaudiosrc, should help with a problem on systems with no alsasrc element."

2084. By Jeff Lane 

"[r=zkrynicki][bug=1169488][author=bladernr] automatic merge by tarmac"

2085. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2086. By Jeff Marcom

"[r=roadmr][bug=][author=jeffmarcom] automatic merge by tarmac"

2087. By Jeff Lane 

"[r=zkrynicki][bug=1065983][author=bladernr] automatic merge by tarmac"

2088. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2089. By Brendan Donegan

"[r=zkrynicki][bug=1173103][author=brendan-donegan] automatic merge by tarmac"

2090. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] plainbox sru: Better handling of server return data, particularly to output the submission status URL if it's in the response"

2091. By Brendan Donegan

Incremented version in changelog

2092. By Zygmunt Krynicki

"[r=zkrynicki][bug=1172835][author=roadmr] xml: Set OPTION_WITH_COMMENTS so they get exported. Actually set the comment when a job has OUTCOME_NOT_SUPPORTED."

2093. By Jeff Lane 

"[r=roadmr][bug=1078897][author=bladernr] automatic merge by tarmac"

2094. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2095. By Jeff Lane 

"[r=zkrynicki][bug=1072666][author=bladernr] automatic merge by tarmac"

2096. By Jeff Lane 

"[r=roadmr][bug=970857][author=bladernr] automatic merge by tarmac"

2097. By Sylvain Pineau

"[r=roadmr][bug=1172851][author=sylvain-pineau] scripts/gpu_test: Raring version"

2098. By Jeff Lane 

"[r=roadmr][bug=1111878][author=bladernr] automatic merge by tarmac"

2099. By Jeff Lane 

"[r=zkrynicki][bug=1103647][author=bladernr] automatic merge by tarmac"

2100. By Brendan Donegan

"[r=zkrynicki][bug=1093718][author=brendan-donegan] automatic merge by tarmac"

2101. By Jeff Lane 

"[r=brendan-donegan][bug=1100594][author=bladernr] automatic merge by tarmac"

2102. By Jeff Lane 

"[r=zkrynicki][bug=1128017][author=bladernr] automatic merge by tarmac"

2103. By Jeff Lane 

"[r=zkrynicki][bug=1116681][author=bladernr] automatic merge by tarmac"

2104. By Sylvain Pineau

"[r=zkrynicki][bug=1167733][author=sylvain-pineau] udev parser: Only filter devices without product AND vendor information"

2105. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

2106. By Brendan Donegan

Incremented version

2107. By Sylvain Pineau

"[r=sylvain-pineau,zkrynicki][bug=][author=sylvain-pineau] automatic merge by tarmac"

2108. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] checkbox_trusted_launcher: Add the --warmup option"

2109. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2110. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2111. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Warm up: Ask the password before running the tests"

2112. By Shawn Wang

"[r=sylvain-pineau][bug=][author=shawn111] automatic merge by tarmac"

2113. By Sylvain Pineau

"[r=sylvain-pineau][bug=][author=sylvain-pineau] doc: typo fixed"

2114. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2115. By Jeff Lane 

"[r=zkrynicki][bug=1153894][author=bladernr] automatic merge by tarmac"

2116. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2117. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2118. By Alberto Milone

"[r=brendan-donegan,cypressyew][bug=][author=albertomilone] automatic merge by tarmac"

2119. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] secure: checkbox-trusted-mauncher: unpack the env list and suppress the _data['via'] hack "

2120. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2121. By Brendan Donegan

"[r=sylvain-pineau][bug=][author=brendan-donegan] automatic merge by tarmac"

2122. By Sylvain Pineau

"[r=roadmr][bug=][author=sylvain-pineau] docs: dev: Added the checkbox-trusted-launcher documentation."

2123. By Daniel Manrique

"[r=zkrynicki][bug=1176695][author=roadmr] automatic merge by tarmac"

2124. By Jeff Lane 

"[r=roadmr][bug=1180496][author=bladernr] automatic merge by tarmac"

2125. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2126. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2127. By Brendan Donegan

Incremented version

2128. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2129. By Sylvain Pineau

"[r=roadmr,zkrynicki][bug=][author=sylvain-pineau] scripts/gpu_test: Call firefox instead of the default browser."

2130. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2131. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] Removes "sudo" from plainbox invocation in .desktop autostart file."

2132. By Zygmunt Krynicki

"[r=zkrynicki,roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2133. By Daniel Manrique

Merged better parsing of EFI in kernel logs by spineau, and fixed misplaced changelog entry

2134. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] contrib: policykit_yes: Allow the polkit action for any kind of sessions"

2135. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2136. By Zygmunt Krynicki

"[r=roadmr,sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2137. By Zygmunt Krynicki

"[r=roadmr,zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2138. By Daniel Manrique

"[r=roadmr,zkrynicki][bug=1182489][author=roadmr] Fixed the optical_drive resource so it correctly handles systems with no optical drive."

2139. By Sylvain Pineau

"[r=roadmr][bug=][author=sylvain-pineau] Exporter: Added the needed code to recreate job categories (based on local jobs)"

2140. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2141. By Brendan Donegan

"[r=roadmr][bug=][author=brendan-donegan] automatic merge by tarmac"

2142. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2143. By Daniel Manrique

"[r=zkrynicki][bug=1183271][author=roadmr] Added some missing plugins to POTFILES.in, so their strings can be translated."

2144. By Daniel Manrique

"[r=roadmr][bug=1183236][author=roadmr] Reorders one field in the xml exporter's "summary" section to avoid triggering the linked bug."

2145. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2146. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2147. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2148. By Sylvain Pineau

"[r=roadmr][bug=1185382][author=sylvain-pineau] secure: checkbox-trusted-launcher.py: Force usage of bash to run commands."

2149. By Daniel Manrique

"[r=sylvain-pineau][bug=][author=roadmr] Updated checkbox debian rules to use setup.py test instead of the old test script"

2150. By Brendan Donegan

Incremented version

2151. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2152. By Jeff Lane 

"[r=roadmr][bug=1186259][author=bladernr] automatic merge by tarmac"

2153. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2154. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2155. By Zygmunt Krynicki

"[r=zkrynicki,brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2156. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2157. By Brendan Donegan

"[r=zkrynicki][bug=1185759][author=brendan-donegan] automatic merge by tarmac"

2158. By Brendan Donegan

"[r=zkrynicki][bug=1180342][author=brendan-donegan] automatic merge by tarmac"

2159. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2160. By Brendan Donegan

"[r=roadmr][bug=1181952][author=brendan-donegan] automatic merge by tarmac"

2161. By Daniel Manrique

"[r=bladernr][bug=][author=roadmr] fixes a few inconsistencies in how the sleep_test fallback command for suspend/hibernate stress tests is called."

2162. By Zygmunt Krynicki

"[r=zkrynicki,sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2163. By Sylvain Pineau

"[r=zkrynicki][bug=1184197][author=sylvain-pineau] scripts/package_resource: updated version supporting both precise and newer releases"

2164. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2165. By Sylvain Pineau

"[r=sylvain-pineau][bug=][author=sylvain-pineau] scripts/audio_settings: Guess the right profile to select for HDMI / DisplayPort tests."

2166. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

2167. By Jeff Lane 

"[r=roadmr][bug=1188284][author=bladernr] automatic merge by tarmac"

2168. By Brendan Donegan

"[r=roadmr][bug=1184882][author=brendan-donegan] automatic merge by tarmac"

2169. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] checkbox-old/checkbox/parsers/pactl.py: Added support for Raring."

2170. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2171. By Jeff Marcom

"[r=roadmr][bug=][author=jeffmarcom] automatic merge by tarmac"

2172. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2173. By Jeff Lane 

"[r=roadmr][bug=1188221][author=bladernr] automatic merge by tarmac"

2174. By Sylvain Pineau

"[r=sylvain-pineau][bug=][author=sylvain-pineau] checkbox-old/checkbox/scripts: New location for scripts unit tests"

2175. By Zygmunt Krynicki

"[r=sylvain-pineau,roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2176. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2177. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2178. By Brendan Donegan

"[r=zkrynicki][bug=1177647][author=brendan-donegan] automatic merge by tarmac"

2179. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] setup.py: Use setuptools find_packages(), more future proof."

2180. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] Revert rev. 2170 (Saucy target)"

2181. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2182. By Sylvain Pineau

"[r=zkrynicki][bug=][author=sylvain-pineau] checkbox-old/checkbox/scripts: New location for scripts unit tests"

2183. By Brendan Donegan

"[r=brendan-donegan,zkrynicki][bug=1188601][author=brendan-donegan] automatic merge by tarmac"

2184. By Zygmunt Krynicki

"[r=zkrynicki,sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2185. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2186. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2187. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2188. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2189. By Daniel Manrique

"[r=bladernr][bug=1187216][author=roadmr] Added a test that validates that manual (user-verify and user-interact included) jobs contain the verification field in their description, without which the Qt UI tends to skip tests."

2190. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2191. By Zygmunt Krynicki

"[r=][bug=][author=zkrynicki] automatic merge by tarmac"

2192. By Brendan Donegan

Incremented version

2193. By Zygmunt Krynicki

"[r=][bug=][author=zkrynicki] automatic merge by tarmac"

2194. By Sylvain Pineau

"[r=roadmr][bug=1191011][author=sylvain-pineau] checkbox-old/checkbox/scripts/audio-settings.py: fix the profile backup method"

2195. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2196. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2197. By Brendan Donegan

"[r=roadmr][bug=1192093][author=brendan-donegan] automatic merge by tarmac"

2198. By Jeff Marcom

"[r=roadmr][bug=1185642][author=jeffmarcom] automatic merge by tarmac"

2199. By Brendan Donegan

Emergency patch to broken udev_attachment job.

2200. By Jeff Marcom

scripts/virtualization: Fixed issue where log file was lost with temp directory after test completion and resolved issue where test would not execute due to unecessary AttributeError exception catching during arg parsing

Signed-off-by: Jeff Marcom <email address hidden>

2201. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2202. By Brendan Donegan

"[r=roadmr][bug=][author=brendan-donegan] automatic merge by tarmac"

2203. By Daniel Manrique

"[r=bladernr][bug=][author=roadmr] Refactoring of audio_test for Python3 and Gstreamer 1.0, with new peak detection algorithm."

2204. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

2205. By Zygmunt Krynicki

"[r=brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2206. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2207. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

2208. By Brendan Donegan

"[r=zkrynicki][bug=][author=brendan-donegan] automatic merge by tarmac"

2209. By Launchpad Translations on behalf of checkbox-dev

Launchpad automatic translations update.

2210. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2211. By Zygmunt Krynicki

"[r=brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2212. By Brendan Donegan

Incremented changelog

2213. By Zygmunt Krynicki

"[r=roadmr,brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2214. By Zygmunt Krynicki

"[r=roadmr][bug=][author=zkrynicki] automatic merge by tarmac"

2215. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2216. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2217. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2218. By Brendan Donegan

"[r=zkrynicki][bug=1196531][author=brendan-donegan] automatic merge by tarmac"

2219. By Daniel Manrique

"[r=zkrynicki][bug=1097816][author=roadmr] This removes the deprecated gksu privileged execution mechanism, and replaces it with pkexec, along with a policy file so the backend can launch graphical programs and ask for proper authorization.
"

2220. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2221. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2222. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2223. By Zygmunt Krynicki

"[r=sylvain-pineau][bug=][author=zkrynicki] automatic merge by tarmac"

2224. By Brendan Donegan

"[r=bladernr][bug=1184661][author=brendan-donegan] automatic merge by tarmac"

2225. By Brendan Donegan

"[r=roadmr][bug=1196838][author=brendan-donegan] automatic merge by tarmac"

2226. By Daniel Manrique

"[r=zkrynicki][bug=][author=roadmr] Syncs the packaging branches. The only differences should be:

- changelog differences
- checkbox/debian does not reference checkbox-old.
- checkbox refers to itself (checkbox trunk) in the control Vcs-Bzr field.

Also see this merge request for the syncing changes to checkbox-packaging.

https://code.launchpad.net/~roadmr/checkbox/packaging-sync-packaging/+merge/172911"

2227. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2228. By Alberto Milone

"[r=brendan-donegan][bug=][author=albertomilone] checkbox-old/scripts/color_depth_info:
1) Prevent a UnicodeDecodeError. I can reproduce this with Python 3 in Saucy (the one in Precise works fine)
2) Be more strict in the regex so that we don't catch undesired strings."

2229. By Zygmunt Krynicki

"[r=zkrynicki,roadmr,brendan-donegan][bug=][author=zkrynicki] automatic merge by tarmac"

2230. By Zygmunt Krynicki

"[r=zkrynicki][bug=][author=zkrynicki] automatic merge by tarmac"

2231. By Zygmunt Krynicki

plainbox:testing_utils: add ResourceCache

[work in progress, needs to become weak]

This class allows to share data among test cases.
It is used by integration tests to run jobs once and observe multiple
properties of each job in a separate test case.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2232. By Zygmunt Krynicki

plainbox:integration_tests: add load_scenario_data() and execute_job()

[work in progress, needs docstring updates]

Those functions are going to replace the current implementation of
integration test suite. They grew to be too big to keep in the test
class itself

Signed-off-by: Zygmunt Krynicki <email address hidden>

2233. By Zygmunt Krynicki

plainbox:integration_tests: parametrize integration tests by scenario path, not job name

To support testing a single job multiple times (in various configurations)
we need to decouple the test scenario from the job it operates on.

Each job can have multiple scenarios that affect it, for example
with and without dependencies, on various OS versions, with various
hardware, etc.

[ this patch breaks the tree but is shorter to review ]

Signed-off-by: Zygmunt Krynicki <<email address hidden>

2234. By Zygmunt Krynicki

plainbox:integration_tests: load scenario data and run the job (if needed) during setUp()

This allows actual test methods to simply check if some of the
job result (be it return code or the output) matches expectations
encoded in the test scenario, thus making tests easier to read.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2235. By Zygmunt Krynicki

plainbox:integration_tests: replace test_job_result() with test_job_result() and test_job_return_code()

The old test_job_result() was responsible for loading and running
everything. The new methods just observe state that was established
during setUp()

Signed-off-by: Zygmunt Krynicki <email address hidden>

Conflicts:
 plainbox/plainbox/impl/integration_tests.py

2236. By Zygmunt Krynicki

plainbox:integration_tests: skip scenarios that are not intended for the current profile

[work in progress]

Profile is currently hard-coded as there is no easy way to pass it from
the test loader. This needs more work.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2237. By Zygmunt Krynicki

plainbox:test-data: update integration testing scenarios to the current format

The real change is anchoring the result in the "result" key and adding
"job_name" as a parameter.

Signed-off-by: Zygmunt Krynicki <email address hidden>

Unmerged revisions

2237. By Zygmunt Krynicki

plainbox:test-data: update integration testing scenarios to the current format

The real change is anchoring the result in the "result" key and adding
"job_name" as a parameter.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2236. By Zygmunt Krynicki

plainbox:integration_tests: skip scenarios that are not intended for the current profile

[work in progress]

Profile is currently hard-coded as there is no easy way to pass it from
the test loader. This needs more work.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2235. By Zygmunt Krynicki

plainbox:integration_tests: replace test_job_result() with test_job_result() and test_job_return_code()

The old test_job_result() was responsible for loading and running
everything. The new methods just observe state that was established
during setUp()

Signed-off-by: Zygmunt Krynicki <email address hidden>

Conflicts:
 plainbox/plainbox/impl/integration_tests.py

2234. By Zygmunt Krynicki

plainbox:integration_tests: load scenario data and run the job (if needed) during setUp()

This allows actual test methods to simply check if some of the
job result (be it return code or the output) matches expectations
encoded in the test scenario, thus making tests easier to read.

Signed-off-by: Zygmunt Krynicki <email address hidden>

2233. By Zygmunt Krynicki

plainbox:integration_tests: parametrize integration tests by scenario path, not job name

To support testing a single job multiple times (in various configurations)
we need to decouple the test scenario from the job it operates on.

Each job can have multiple scenarios that affect it, for example
with and without dependencies, on various OS versions, with various
hardware, etc.

[ this patch breaks the tree but is shorter to review ]

Signed-off-by: Zygmunt Krynicki <<email address hidden>

2232. By Zygmunt Krynicki

plainbox:integration_tests: add load_scenario_data() and execute_job()

[work in progress, needs docstring updates]

Those functions are going to replace the current implementation of
integration test suite. They grew to be too big to keep in the test
class itself

Signed-off-by: Zygmunt Krynicki <email address hidden>

2231. By Zygmunt Krynicki

plainbox:testing_utils: add ResourceCache

[work in progress, needs to become weak]

This class allows to share data among test cases.
It is used by integration tests to run jobs once and observe multiple
properties of each job in a separate test case.

Signed-off-by: Zygmunt Krynicki <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plainbox/plainbox/impl/integration_tests.py'
--- plainbox/plainbox/impl/integration_tests.py 2013-04-04 17:12:13 +0000
+++ plainbox/plainbox/impl/integration_tests.py 2013-07-05 11:51:23 +0000
@@ -38,11 +38,21 @@
38from plainbox.testing_utils.cwd import TestCwd38from plainbox.testing_utils.cwd import TestCwd
39from plainbox.testing_utils.io import TestIO39from plainbox.testing_utils.io import TestIO
40from plainbox.testing_utils.testcases import TestCaseWithParameters40from plainbox.testing_utils.testcases import TestCaseWithParameters
41from plainbox.testing_utils.resource import ResourceCache
4142
4243
43class IntegrationTests(TestCaseWithParameters):44class IntegrationTests(TestCaseWithParameters):
4445 """
45 parameter_names = ('job_name',)46 Test cases for checking execution and outcome of checkbox jobs.
47 Each test case is parametrized by the job name and execution "profile".
48
49 The profile is simply a string that somehow characterizes where this test
50 is applicable.
51 """
52
53 cache = ResourceCache()
54
55 parameter_names = ('scenario_pathname',)
4656
47 def setUp(self):57 def setUp(self):
48 # session data are kept in XDG_CACHE_HOME/plainbox/.session58 # session data are kept in XDG_CACHE_HOME/plainbox/.session
@@ -51,24 +61,58 @@
51 self._sandbox = tempfile.mkdtemp()61 self._sandbox = tempfile.mkdtemp()
52 self._env = os.environ62 self._env = os.environ
53 os.environ['XDG_CACHE_HOME'] = self._sandbox63 os.environ['XDG_CACHE_HOME'] = self._sandbox
64 # Load the expected results and keep them in memory
65 self.scenario_data = self.cache.get(
66 key=('scenario_data', self.parameters.scenario_pathname),
67 operation=lambda: load_scenario_data(
68 self.parameters.scenario_pathname))
69 # Skip tests that are not applicable for the current system
70 self.skip_if_incompatible()
71 # Execute the job and remember the results.
72 (self.job_result, self.job_return_code, self.job_stdout,
73 self.job_stderr) = self.cache.get(
74 key=('job-run-artifacts', self.parameters.scenario_pathname),
75 operation=lambda: execute_job(self.scenario_data['job_name']))
76
77 def test_job_result(self):
78 # Check that results match expected values
79 self.assertEqual(self.job_result, self.scenario_data.get("result"))
80
81 def test_job_return_code(self):
82 # Check the return code for correctness
83 self.assertEqual(self.job_return_code,
84 self.scenario_data.get("return_code", 0))
85
86 def skip_if_incompatible(self):
87 """
88 Skip a job if it is incompatible with the current environment
89 """
90 if self.scenario_data.get('profile') != 'default':
91 self.skipTest("not applicable for current profile")
5492
55 @classmethod93 @classmethod
56 def _gen_job_name_values(cls, package='plainbox',94 def _discover_test_scenarios(cls, package='plainbox',
57 root='test-data/integration-tests/'):95 dirname="/test-data/integration-tests/",
96 extension=".json"):
58 """97 """
59 Discover job names for jobs that we have reference data for98 Discover test scenarios.
99
100 Generates special absolute pathnames to scenario files. All those paths
101 are really relative to the plainbox package. Those pathnames are
102 suitable for pkg_resources.resource_ functions.
60103
61 All reference data should be dropped to104 All reference data should be dropped to
62 ``plainbox/test-data/integration-tests/`` as a json file105 ``plainbox/test-data/integration-tests/`` as a json file
63 """106 """
64 for name in resource_listdir(package, root):107 for name in resource_listdir(package, dirname):
65 resource_name = os.path.join(root, name)108 resource_pathname = os.path.join(dirname, name)
66 if resource_isdir(package, resource_name):109 if resource_isdir(package, resource_pathname):
67 for item in cls._gen_job_name_values(package, resource_name):110 for item in cls._discover_test_scenarios(package,
111 resource_pathname,
112 extension):
68 yield item113 yield item
69 elif resource_name.endswith('.json'):114 elif resource_pathname.endswith(extension):
70 yield resource_name[115 yield resource_pathname
71 len('test-data/integration-tests/'):-len('.json')]
72116
73 @classmethod117 @classmethod
74 def get_parameter_values(cls):118 def get_parameter_values(cls):
@@ -77,39 +121,57 @@
77121
78 Creates subsequent tuples for each job that has reference data122 Creates subsequent tuples for each job that has reference data
79 """123 """
80 for job_name in cls._gen_job_name_values():124 for scenario_pathname in cls._discover_test_scenarios():
81 yield (job_name,)125 yield (scenario_pathname,)
82
83 def test_job_result(self):
84 # Create a scratch directory so that we can save results there. The
85 # shared directory is also used for running tests as some test jobs
86 # leave junk around the current directory.
87 with TemporaryDirectory() as scratch_dir:
88 # Save results to results.json in the scratch directory
89 actual_results_path = os.path.join(scratch_dir, 'results.json')
90 # Redirect all standard IO so that the test is silent.
91 # Run the script, having relocated to the scratch directory
92 # Capture SystemExit that is always raised by main() so that
93 # we can observe the return code as well.
94 with TestIO(), TestCwd(scratch_dir),\
95 self.assertRaises(SystemExit) as call:
96 main(['run', '-i', self.parameters.job_name,
97 '--output-format=json', '-o', actual_results_path])
98 # Check the return code for correctness
99 self.assertEqual(call.exception.args, (0,))
100 # Load the actual results and keep them in memory
101 with open(actual_results_path, encoding='UTF-8') as stream:
102 actual_result = json.load(stream)
103 # [ At this time TestIO and TemporaryDirectory are gone ]
104 # Load the expected results and keep them in memory
105 reference_path = resource_filename(
106 "plainbox", "test-data/integration-tests/{}.json".format(
107 self.parameters.job_name))
108 with open(reference_path, encoding='UTF-8') as stream:
109 expected_result = json.load(stream)
110 # Check that results match expected values
111 self.assertEqual(actual_result, expected_result)
112126
113 def tearDown(self):127 def tearDown(self):
114 shutil.rmtree(self._sandbox)128 shutil.rmtree(self._sandbox)
115 os.environ = self._env129 os.environ = self._env
130
131
132def load_scenario_data(scenario_pathname):
133 """
134 Load and return scenario data.
135
136 Data is loaded from a .json file located in the plainbox package
137 directory. Individual files are named after the jobs they describe.
138 """
139 pathname = resource_filename("plainbox", scenario_pathname)
140 with open(pathname, encoding='UTF-8') as stream:
141 return json.load(stream)
142
143
144def execute_job(job_name):
145 """
146 Execute the specified job.
147
148 The job is invoked using a high-level interface from box so the test will
149 actually execute the same way as the UI would execute it. It will
150 create/tear-down appropriate session objects as well.
151
152 Returns (result, return_code) where result is the deserialized JSON saved
153 at the end of the job.
154 """
155 # Create a scratch directory so that we can save results there. The
156 # shared directory is also used for running tests as some test jobs
157 # leave junk around the current directory.
158 with TemporaryDirectory() as scratch_dir:
159 # Save results to results.json in the scratch directory
160 pathname = os.path.join(scratch_dir, 'results.json')
161 # Redirect all standard IO so that the test is silent.
162 # Run the script, having relocated to the scratch directory
163 with TestIO() as io, TestCwd(scratch_dir):
164 try:
165 main(['run', '-i', job_name,
166 '--output-format=json', '-o', pathname])
167 except SystemExit as exc:
168 # Capture SystemExit that is always raised by main() so that we
169 # can observe the return code as well.
170 job_return_code = exc.args[0]
171 else:
172 job_return_code = None
173 # Load the actual results and keep them in memory
174 with open(pathname, encoding='UTF-8') as stream:
175 job_result = json.load(stream)
176 # [ At this time TestIO and TemporaryDirectory are gone ]
177 return job_result, job_return_code, io.stdout, io.stderr
116178
=== modified file 'plainbox/plainbox/test-data/integration-tests/cpu/scaling_test.json'
--- plainbox/plainbox/test-data/integration-tests/cpu/scaling_test.json 2013-03-15 15:49:18 +0000
+++ plainbox/plainbox/test-data/integration-tests/cpu/scaling_test.json 2013-07-05 11:51:23 +0000
@@ -1,10 +1,14 @@
1{1{
2 "result_map": {2 "profile": "default",
3 "cpu/scaling_test": {3 "job_name": "cpu/scaling_test",
4 "outcome": "pass"4 "result": {
5 }, 5 "result_map": {
6 "package": {6 "cpu/scaling_test": {
7 "outcome": "pass"7 "outcome": "pass"
8 },
9 "package": {
10 "outcome": "pass"
11 }
8 }12 }
9 }13 }
10}
11\ No newline at end of file14\ No newline at end of file
15}
1216
=== added file 'plainbox/plainbox/testing_utils/resource.py'
--- plainbox/plainbox/testing_utils/resource.py 1970-01-01 00:00:00 +0000
+++ plainbox/plainbox/testing_utils/resource.py 2013-07-05 11:51:23 +0000
@@ -0,0 +1,60 @@
1# This file is part of Checkbox.
2#
3# Copyright 2013 Canonical Ltd.
4# Written by:
5# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
6#
7# Checkbox is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# Checkbox is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
19
20"""
21plainbox.testing_utils.resource
22===============================
23
24Implementation of simple resource sharing cache for unit tests
25"""
26
27import weakref
28
29
30class ResourceCache:
31 """
32 Mix-in for having cached resources that are shared and reused by all
33 instances. If your test needs to compute something (slowly) and reuse
34 it in various different test_ methods then this will save time.
35 """
36
37 def __init__(self):
38 """
39 Initialize a new ResourceCache object
40 """
41 # XXX: it would be nice to have something like true cache semantics of
42 # java's SoftReference system. We do the second best thing which is to
43 # use weak references on the values held in the cache.
44 # self.weak_cache = weakref.WeakValueDictionary()
45 self.weak_cache = {}
46
47 def get(self, key, operation):
48 """
49 Get a value from the cache, falling back to computing it if needed
50
51 Gets something from the cache dictionary, referenced by the key. If the
52 value is missing it is computed, by calling the operation, and stored
53 in the cache.
54 """
55 try:
56 value = self.weak_cache[key]
57 except KeyError:
58 value = operation()
59 self.weak_cache[key] = value
60 return value

Subscribers

People subscribed via source and target branches