tf_fuzz: fix ps teardown boilerplate and disable teardown for write once assets

Fix failing demos 14,16,35 by fixing the teardown boilerplate and no
longer generating asset teardown code for Protected Storage assets with
the WRITE_ONCE flag.

Protected Storage assets with the WRITE_ONCE flag set cannot be removed
after creation. However, all Protected Storage assets, including those
with WRITE_ONCE, currently have teardown code that removes the asset
and ensures that this happened sucessfully. This causes test failures
for WRITE_ONCE assets.

As WRITE_ONCE assets now persist between tests, there is a possibility
that asset UIDs in different tests could collide. Because of this,
WRITE_ONCE can no longer be given to a PS asset during random flag
selection, and must be explicitly specified in the test template.

Change-Id: I4fa79f33851b6e580109acd4e40238c04e7ea773
Signed-off-by: Nik Dewally <Nik.Dewally@arm.com>
diff --git a/tf_fuzz/tfz-cpp/utility/data_blocks.cpp b/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
index 09a25e9..c84d4d2 100644
--- a/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
+++ b/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -105,30 +105,19 @@
 
 string set_data_info::rand_creation_flags (void)
 {
-    return ((rand() % 2) == 1)?
-        "PSA_STORAGE_FLAG_WRITE_ONCE" : "PSA_STORAGE_FLAG_NONE";
-
-    /* TODO:  There are also PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION and
-              PSA_STORAGE_FLAG_NO_CONFIDENTIALITY, but they don't seem to appear
-              in any test suites, so it's iffy as to whether they really exist.
-              We'll not routinely initialize to them, for now at least, but if
-              we want to enable them, then uncomment the following:
     string result = "";
-    const int most_flags = 2,
+    const int most_flags = 2;
     int n_flags = (rand() % most_flags);
 
-    for (int i = 0;  i < ;  i < n_flags;  ++i) {
-        switch (rand() % 4) {
+    for (int i = 0; i < n_flags;  ++i) {
+        switch (rand() % 3) {
             case 0:
                 result += "PSA_STORAGE_FLAG_NONE";
                 break;
             case 1:
-                result += "PSA_STORAGE_FLAG_WRITE_ONCE";
-                break;
-            case 2:
                 result += "PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION";
                 break;
-            case 3:
+            case 2:
                 result += "PSA_STORAGE_FLAG_NO_CONFIDENTIALITY";
                 break;
         }
@@ -136,7 +125,8 @@
             result += " | ";
     }
     if (result == "") result = "PSA_STORAGE_FLAG_NONE";
-*/
+
+    return result;
 }
 
 set_data_info::set_data_info (void)  // (default constructor)