1414
1515log = logging .getLogger (__file__ )
1616
17+
1718class TestResource (JumpstarterTest ):
18- filter_labels = {"board" :"rpi4" }
19+ filter_labels = {"board" : "rpi4" }
1920
2021 @classmethod
2122 def teardown_class (cls ):
@@ -52,8 +53,9 @@ def test_setup_device(self, client, console):
5253 try :
5354 client .dutlink .storage .write_local_file ("image/images/latest.raw" )
5455 except opendal .exceptions .NotFound :
55- pytest .exit ("No image found, please enter the image directory and run `make`, "
56- "more details in the README.md" )
56+ pytest .exit (
57+ "No image found, please enter the image directory and run `make`, " "more details in the README.md"
58+ )
5759 return
5860 client .dutlink .storage .dut ()
5961 client .dutlink .power .on ()
@@ -66,13 +68,15 @@ def test_setup_device(self, client, console):
6668 def test_tpm2_device (self , shell ):
6769 shell .logfile_read = sys .stdout .buffer
6870
69- lines = ["apt-get install -y tpm2-tools" ,
70- "tpm2_createprimary -C e -c primary.ctx" ,
71- "tpm2_create -G rsa -u key.pub -r key.priv -C primary.ctx" ,
72- "tpm2_load -C primary.ctx -u key.pub -r key.priv -c key.ctx" ,
73- "echo my message > message.dat" ,
74- "tpm2_sign -c key.ctx -g sha256 -o sig.rssa message.dat" ,
75- "tpm2_verifysignature -c key.ctx -g sha256 -s sig.rssa -m message.dat" ]
71+ lines = [
72+ "apt-get install -y tpm2-tools" ,
73+ "tpm2_createprimary -C e -c primary.ctx" ,
74+ "tpm2_create -G rsa -u key.pub -r key.priv -C primary.ctx" ,
75+ "tpm2_load -C primary.ctx -u key.pub -r key.priv -c key.ctx" ,
76+ "echo my message > message.dat" ,
77+ "tpm2_sign -c key.ctx -g sha256 -o sig.rssa message.dat" ,
78+ "tpm2_verifysignature -c key.ctx -g sha256 -s sig.rssa -m message.dat" ,
79+ ]
7680
7781 for line in lines :
7882 log .info (f"Running command: { line } " )
0 commit comments