agent: added tests for tag marshalling functions