tests: add test for frame buffer interface #4227

Merged
merged 2 commits into from Nov 23, 2017

Conversation

Projects
None yet
5 participants
Contributor

sergiocazzolato commented Nov 15, 2017

To test this use a device which has the file /dev/fb0, most of the cloud images don't have it.

@sergiocazzolato sergiocazzolato changed the title from Adding test for interface frame buffer to tests: adding test for interface frame buffer Nov 15, 2017

codecov-io commented Nov 16, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@54ded85). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4227   +/-   ##
=========================================
  Coverage          ?   75.97%           
=========================================
  Files             ?      442           
  Lines             ?    38483           
  Branches          ?        0           
=========================================
  Hits              ?    29239           
  Misses            ?     7229           
  Partials          ?     2015

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54ded85...b8679b0. Read the comment docs.

@zyga zyga changed the title from tests: adding test for interface frame buffer to tests: add test for frame buffer interface Nov 16, 2017

@zyga zyga requested a review from mvo5 Nov 16, 2017

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+head -c 10 /dev/fb0
@bboozzoo

bboozzoo Nov 17, 2017

Contributor

I'd probably make this a dd if=/dev/fb0 of=/dev/null count=10. IIRC head will stop after hitting a 0 in the input, or use od -N 10 if the content is important/

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+echo "$1" | dd bs=4 seek=$((100 * 1024 + 200)) >/dev/fb0
@bboozzoo

bboozzoo Nov 17, 2017

Contributor

I think you mean:
echo "$1" | dd bs=4 seek=$((100*1024 + 200)) of=/dev/fb0

Looks good overall, thanks for the test. Some trivials + a question.

+name: test-snapd-framebuffer
+version: 1.0
+summary: Basic snap to check access to file system
+description: A basic snap to check access to file system
@stolowski

stolowski Nov 17, 2017

Contributor

Both summary and description need changing, looks like a copy-paste from another test.

+ The test also checks the interface connection and disconnection works properly.
+
+prepare: |
+ snap try $TESTSLIB/snaps/test-snapd-framebuffer
@stolowski

stolowski Nov 17, 2017

Contributor

We should probably snap remove it in restore?

@sergiocazzolato

sergiocazzolato Nov 22, 2017

Contributor

Thanks for reviewing this. Snaps are automatically removed in the reset.sh script which is called in the test setup.

+
+ if [ ! -e /dev/fb0 ]; then
+ echo "Framebuffer not available on /dev/fb0"
+ exit 0
@stolowski

stolowski Nov 17, 2017

Contributor

Is this intended, shouldn't this be an error? Or is it available on some of the systems only? Should we restrict this test to be run on select systems instead?

@sergiocazzolato

sergiocazzolato Nov 22, 2017

Contributor

That could be done for sure, but as I was asked to detect it dinamically the path in the uhid test (which is similat to this one), I though that should be better to make this detection dinamic here.

Thank you, LGTM. +1

mvo5 approved these changes Nov 23, 2017

@mvo5 mvo5 merged commit 4f31cea into snapcore:master Nov 23, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment