[autotest] Compute perf dashboard point IDs before sending.

Currently, this point ID is constructed on the perf dashboard side
when the data is received.

I believe that it's more ideal if the Chrome-OS-specific logic
is moved here:
 - This will simplify the dashboard code and make it more consistent.
 - This also means that if we want to send Chrome OS data with
   different kinds of point IDs, that's also possible.

This also adds validation for the version numbers, so that when a
version number that doesn't match the expected format is used,
a clearer error message should be printed.

BUG=chromium:476188
TEST=Test case test_get_id_from_version and test_get_version_numbers added.

Change-Id: I193dc05d9621d08f1add2a4c0aebf63b01afc3b1
Reviewed-on: https://chromium-review.googlesource.com/265726
Reviewed-by: Fang Deng <fdeng@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Trybot-Ready: Quinten Yearsley <qyearsley@chromium.org>
Tested-by: Quinten Yearsley <qyearsley@chromium.org>
2 files changed