I tried to build a snap with the factory-diag-test branch today on 14.04, and encountered the very same issue.
For this bug, Jonathan's patch works like a charm.
After that, I got blocked with another issue, it returns non-zero value because of a command in the end: which "factory-diag-test"
And this does not exist, thus the return value is not 0. (I think this will be another issue)
I tried to build a snap with the factory-diag-test branch today on 14.04, and encountered the very same issue.
For this bug, Jonathan's patch works like a charm.
After that, I got blocked with another issue, it returns non-zero value because of a command in the end:
which "factory-diag-test"
And this does not exist, thus the return value is not 0. (I think this will be another issue)