add a unit test Signed-off-by: Daniel Nephin <dnephin@docker.com> (cherry picked from commit 07b59ef210490df19f65da950d7d41176d104a31)