Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lwc
/
compare
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
00c79c4b
authored
Mar 03, 2020
by
lwc-tester
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaaaaaaaaaaaaaa
parent
941d12c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
11 deletions
+66
-11
compile_all.py
+0
-1
process_zip.sh
+22
-9
templates/f7/test
+1
-1
test_scheduler.py
+43
-0
No files found.
compile_all.py
View file @
00c79c4b
...
...
@@ -214,7 +214,6 @@ def main(argv):
print
()
print
()
print
(
"Now execute '
%
s ' to start the test"
%
test_script_path
)
if
__name__
==
"__main__"
:
...
...
process_zip.sh
View file @
00c79c4b
...
...
@@ -2,6 +2,7 @@
shopt
-s
extglob
export
PYTHONPATH
=
"
$PYTHONPATH
:
$(
pwd
)
"
function
run
()
{
TEMPLATE
=
"
$1
"
...
...
@@ -31,28 +32,38 @@ function run() {
./compile_all.py
-t
"templates/
$TEMPLATE
"
-b
"
$TMPDIR
"
for
cipher
in
$TMPDIR
/
*
;
do
CIPHER_SLUG
=
$(
basename
$cipher
)
if
[[
!
-d
$cipher
]]
;
then continue
;
fi
mkdir
-p
$DESTDIR
/
$CIPHER_SLUG
||
exit
1
mv
$cipher
/
*
.log
$DESTDIR
/
$CIPHER_SLUG
/
mkdir
-p
"./queues"
QUEUE_PATH
=
"./queues/
$TEMPLATE
"
TEST_PATH
=
"
$DESTDIR
/
$CIPHER_SLUG
"
CIPHER_SLUG
=
$(
basename
$cipher
)
mkdir
-p
"
$TEST_PATH
"
||
exit
1
mv
$cipher
/
*
.log
"
$TEST_PATH
"
mv
"
$cipher
/LWC_AEAD_KAT.txt"
"
$TEST_PATH
"
case
$TEMPLATE
in
f7
)
mv
$cipher
/build/f7.
*
$DESTDIR
/
$CIPHER_SLUG
/
f7
)
mv
$cipher
/build/f7.
*
"
$TEST_PATH
"
;;
maixduino
)
mv
$cipher
/.pio/build/sipeed-maixduino/firmware.
*
$DESTDIR
/
$CIPHER_SLUG
/
maixduino
)
mv
$cipher
/.pio/build/sipeed-maixduino/firmware.
*
"
$TEST_PATH
"
;;
bluepill
)
mv
$cipher
/.pio/build/bluepill_f103c8/firmware.
*
$DESTDIR
/
$CIPHER_SLUG
/
bluepill
)
mv
$cipher
/.pio/build/bluepill_f103c8/firmware.
*
"
$TEST_PATH
"
;;
uno
)
mv
$cipher
/.pio/build/uno/firmware.
*
$DESTDIR
/
$CIPHER_SLUG
/
uno
)
mv
$cipher
/.pio/build/uno/firmware.
*
"
$TEST_PATH
"
;;
esp32
)
mv
$cipher
/.pio/build/esp32dev/firmware.
*
$
DESTDIR
/
$CIPHER_SLUG
/
esp32
)
mv
$cipher
/.pio/build/esp32dev/firmware.
*
$
cipher
/.pio/build/esp32dev/partitions.bin
"
$TEST_PATH
"
;;
esac
CMD
=
"PYTHONPATH=
\$
PYTHONPATH:
$(
pwd
)
python3 './templates/
$TEMPLATE
/test' '
$TEST_PATH
' > '
$TEST_PATH
/test.stdout.log' 2> '
$TEST_PATH
/test.stderr.log'"
printf
-v
CMD
"%q"
"
$CMD
"
flock
"
$QUEUE_PATH
"
bash
-c
"echo
$CMD
>>
\"
$QUEUE_PATH
\"
"
done
rm
-rf
"
$TMPDIR
"
...
...
@@ -69,13 +80,15 @@ else
MAINDIR
=
email-submissions/
$(
date +%Y-%m-%d-%H:%M
)
mkdir
-p
$MAINDIR
unzip
$ZIP_PATH
-d
all-lwc-submission-files
TMPDIR
=
$(
mktemp
-d
-t
submission-XXXXXXXXXX
)
unzip
$ZIP_PATH
-d
$TMPDIR
for
i
in
templates/
*
;
do
TEMPLATE
=
"
${
i
##*/
}
"
echo
"Template is
$TEMPLATE
"
touch
$MAINDIR
/locky.lock
flock
$MAINDIR
/locky.lock
$0
run
$TEMPLATE
$MAINDIR
/
$TEMPLATE
done
rm
-rf
$TMPDIR
fi
...
...
templates/f7/test
View file @
00c79c4b
...
...
@@ -17,7 +17,7 @@ def get_serial():
devices
=
[
p
.
device
for
p
in
ports
if
p
.
serial_number
==
'
FT2XA9MY
'
if
p
.
serial_number
==
'
00000000
'
]
devices
.
sort
()
return
serial
.
Serial
(
...
...
test_scheduler.py
0 → 100755
View file @
00c79c4b
#!/usr/bin/env python3
import
sys
import
time
import
fcntl
import
subprocess
def
file_pop_line
(
path
):
try
:
with
open
(
path
,
'rt+'
)
as
q
:
fcntl
.
lockf
(
q
,
fcntl
.
LOCK_EX
)
first
=
q
.
readline
()
if
first
==
''
:
return
None
rest
=
q
.
read
()
q
.
seek
(
0
)
q
.
write
(
rest
)
q
.
truncate
()
return
first
except
FileNotFoundError
:
return
None
def
main
(
argv
):
test_queue
=
argv
[
1
]
while
1
:
cmd
=
file_pop_line
(
test_queue
)
.
strip
()
if
cmd
is
None
:
time
.
sleep
(
5
)
else
:
print
()
print
(
"Executing
%
s"
%
cmd
)
p
=
subprocess
.
Popen
([
'bash'
,
'-c'
,
cmd
])
p
.
wait
()
print
()
print
(
"Return code is
%
d"
%
p
.
returncode
)
print
()
if
__name__
==
'__main__'
:
sys
.
exit
(
main
(
sys
.
argv
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment