Add tests for codecs and P4Info parser when P4Runtime Translation is used

Change-Id: Ied0e83e81dad29f5b250548d2e26ec960b98f560
diff --git a/protocols/p4runtime/ctl/src/test/resources/bmv2-compile.sh b/protocols/p4runtime/ctl/src/test/resources/bmv2-compile.sh
new file mode 100755
index 0000000..4bcf40b
--- /dev/null
+++ b/protocols/p4runtime/ctl/src/test/resources/bmv2-compile.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+set -e
+
+PROFILE=$1
+OTHER_FLAGS=$2
+
+SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+echo
+echo "## Compiling profile ${PROFILE} in ${SRC_DIR}..."
+
+# Using stable-20210108 because stable doesn't support @p4runtime_translation annotations
+dockerImage=opennetworking/p4c:stable-20210108
+dockerRun="docker run --rm -w ${SRC_DIR} -v ${SRC_DIR}:${SRC_DIR} ${dockerImage}"
+
+
+# Generate BMv2 JSON and P4Info.
+(set -x; ${dockerRun} p4c-bm2-ss --arch v1model \
+        ${OTHER_FLAGS} \
+        --p4runtime-files ${SRC_DIR}/${PROFILE}_p4info.txt ${PROFILE}.p4)