-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix subType streaming validator errors #272
Changes from all commits
6096a51
a87e44d
0826739
37c5b78
da5d19b
22413d3
4f59fb1
5342911
c5dac0e
1ceb669
e4bfd82
196e040
25fdf14
eaaa48d
05a5f33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ fi | |
project_id=$1 | ||
shift | ||
|
||
bin/clone_model | ||
site_path=udmi_site_model | ||
device_id=AHU-1 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash -e | ||
|
||
ROOT_DIR=$(dirname $0)/.. | ||
cd $ROOT_DIR | ||
|
||
if [[ $# != 1 ]]; then | ||
echo Usage: $0 PROJECT_ID | ||
false | ||
fi | ||
project_id=$1 | ||
shift | ||
|
||
site_path=udmi_site_model | ||
device_id=AHU-1 | ||
|
||
serial_no=validator-$RANDOM | ||
echo Using pubber with serial $serial_no | ||
|
||
PUBBER_OUT=pubber.out | ||
|
||
pids=`ps ax | fgrep pubber | fgrep java | awk '{print $1}'` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels heavy handed? Is this to strengthen repeated runs of this test, or to stop interference with other running tests? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes -- but I'd defer any of those changes to something separate from the basic functionality. I agree with your comments, but I wouldn't want to get into it as part of this PR! |
||
if [[ -n $pids ]]; then | ||
echo Killing pubber pids $pids | ||
kill $pids | ||
fi | ||
|
||
rm -rf out/devices | ||
|
||
# Prepare auth key used by reflector | ||
cp udmi_site_model/devices/AHU-1/rsa_private.pkcs8 \ | ||
udmi_site_model/gcp_reflect_key.pkcs8 | ||
|
||
bin/validator $site_path $project_id & | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we trap on exit of validator so we know if it exits while running pubber? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe-- the code as it stands checks the output of what validator does, so it doesn't matter if it exits prematurely or not... Either the generated output is correct or not. |
||
vpid=$! | ||
sleep 10 | ||
echo Started validator pid $vpid | ||
|
||
pubber/bin/build | ||
|
||
echo Writing pubber output to $PUBBER_OUT | ||
echo bin/pubber $site_path $project_id $device_id $serial_no | ||
bin/pubber $site_path $project_id $device_id $serial_no > $PUBBER_OUT 2>&1 & | ||
|
||
WAITING=10 | ||
for i in `seq 1 $WAITING`; do | ||
if fgrep "Connection complete" $PUBBER_OUT; then | ||
break | ||
fi | ||
echo Waiting for pubber startup $((WAITING - i))... | ||
sleep 2 | ||
done | ||
|
||
if [[ $i == $WAITING ]]; then | ||
echo pubber startup failed: | ||
cat $PUBBER_OUT | ||
false | ||
fi | ||
|
||
echo Waiting for system to run for a bit... | ||
sleep 30 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this becomes more cumbersome, or we get unpredictable test results, I suggest using the shell's jobs command to focus our kill usage For example: jobs -x kill %pubber Although I'm not sure whether the shell would see either java or pubber/validator |
||
pids=`ps ax | fgrep pubber | fgrep java | awk '{print $1}'` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or at least pids=`pgrep pubber` ? |
||
echo Killing pids $vpid $pids | ||
kill $vpid $pids | ||
|
||
outfiles=`find out/devices -name \*.out` || true | ||
echo Found .out files $outfiles, copying to /tmp/validator.out | ||
more $outfiles > /tmp/validator.out || true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be cat? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more includes the filename in the output, so it's convenient for logging since you get more context, rather than just a bunch of stuff combined together |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
:::::::::::::: | ||
out/devices/AHU-1/state_pointset.out | ||
:::::::::::::: | ||
While converting to json node: 1 schema violations found | ||
1 schema violations found | ||
object instance has properties which are not allowed by the schema: ["version"] | ||
:::::::::::::: | ||
out/devices/AHU-1/state_system.out | ||
:::::::::::::: | ||
While converting to json node: 2 schema violations found | ||
2 schema violations found | ||
object has missing required properties (["last_config"]) | ||
object instance has properties which are not allowed by the schema: ["version"] | ||
:::::::::::::: | ||
out/devices/AHU-1/state.out | ||
:::::::::::::: | ||
While converting to json node: 2 schema violations found | ||
2 schema violations found | ||
instance value ("states") not found in enum (possible values: ["update","discovery","system","gateway","localnet","metadata","pointset","blobset"]) | ||
instance value ("update") not found in enum (possible values: ["event","command","state","config"]) | ||
While converting to json node: 1 schema violations found | ||
1 schema violations found | ||
object has missing required properties (["last_config"]) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fold this into another PR