From 1451938da05503de1bfcec0610c8c2806829b129 Mon Sep 17 00:00:00 2001
From: Tri Vo <trong@google.com>
Date: Sun, 6 Jan 2019 18:17:32 -0800
Subject: [PATCH] sepolicy: Improve treble test error message.

Bug: 120080521
Test: removing a mapped type in the mapping file triggers new error
message
Change-Id: I04b21da7206777af8c281a843bd39ea5c4f0863a
---
 tests/treble_sepolicy_tests.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/treble_sepolicy_tests.py b/tests/treble_sepolicy_tests.py
index f2d600ad5..0851d3b5d 100644
--- a/tests/treble_sepolicy_tests.py
+++ b/tests/treble_sepolicy_tests.py
@@ -242,7 +242,10 @@ def TestNoUnmappedNewTypes():
         ret += "policy without an entry into the compatibility mapping file(s) "
         ret += "found in private/compat/V.v/V.v[.ignore].cil, where V.v is the "
         ret += "latest API level.\n"
-        ret += " ".join(str(x) for x in sorted(violators)) + "\n"
+        ret += " ".join(str(x) for x in sorted(violators)) + "\n\n"
+        ret += "See examples of how to fix this:\n"
+        ret += "https://android-review.git.corp.google.com/c/platform/system/sepolicy/+/781036\n"
+        ret += "https://android-review.git.corp.google.com/c/platform/system/sepolicy/+/852612\n"
     return ret
 
 ###
@@ -265,7 +268,9 @@ def TestNoUnmappedRmTypes():
         ret += "policy without a declaration in the compatibility mapping "
         ret += "found in private/compat/V.v/V.v[.ignore].cil, where V.v is the "
         ret += "latest API level.\n"
-        ret += " ".join(str(x) for x in sorted(violators)) + "\n"
+        ret += " ".join(str(x) for x in sorted(violators)) + "\n\n"
+        ret += "See examples of how to fix this:\n"
+        ret += "https://android-review.git.corp.google.com/c/platform/system/sepolicy/+/822743\n"
     return ret
 
 def TestTrebleCompatMapping():
-- 
GitLab