summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2018-12-04 15:51:46 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-02-19 18:38:40 +0200
commitf9cf26802d5ab0e28ccf3429914952307f99f5af (patch)
tree5f1e63d6e93667c21cfc0614c509ff2c9d0536d5
parent05630a430abc37c2dbf438c78a686d6ffe4f9261 (diff)
vsp-lib: Reset controls to defaults on each test run
Some of our tests set flipping and rotation controls, and the VSP instance can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing those tests to fail. In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test. To repair this - reset all control values to their defaults at the start of every test during test_init() Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xscripts/vsp-lib.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh
index ee92636..c0eb1ca 100755
--- a/scripts/vsp-lib.sh
+++ b/scripts/vsp-lib.sh
@@ -94,6 +94,14 @@ vsp1_set_control() {
$yavta --no-query -w "$control $value" $subdev | ./logger.sh "$entity" >> $logfile
}
+vsp1_reset_controls() {
+ local entity=$1
+ local subdev=$(vsp1_entity_subdev $entity)
+
+ echo "Resetting controls on $subdev" | ./logger.sh "$entity" >> $logfile
+ $yavta --no-query --reset-controls $subdev | ./logger.sh "$entity" >> $logfile
+}
+
# -----------------------------------------------------------------------------
# Reference frame generation
#
@@ -1074,6 +1082,9 @@ test_init() {
dev=$(vsp1_device $mdev)
echo "Using device $mdev ($dev)" | ./logger.sh config >> $logfile
+ # Reset any rotation or flipping controls
+ vsp1_reset_controls wpf.0
+
vsp_runner=./vsp-runner.sh
}