Add supported_os checking and test cases.
Merge remote-tracking branch 'upstream/master'