From 8e99db9f4f0cc2d0b1d809058ca0b10aa80e3ec4 Mon Sep 17 00:00:00 2001
From: Michael Davis <michael.davis@cern.ch>
Date: Fri, 10 Jan 2020 14:27:35 +0100
Subject: [PATCH] [frontend] Always fails archive requests for files in the
 fail_archive_requests_test storage class

---
 xroot_plugins/XrdSsiCtaRequestMessage.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.cpp b/xroot_plugins/XrdSsiCtaRequestMessage.cpp
index 4b8502aecc..9aa3d4f87e 100644
--- a/xroot_plugins/XrdSsiCtaRequestMessage.cpp
+++ b/xroot_plugins/XrdSsiCtaRequestMessage.cpp
@@ -383,6 +383,11 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c
      throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named sys.archive.storage_class");
    }
 
+   // For testing, this storage class will always fail
+   if(storageClassItor->second == "fail_archive_requests_test") {
+      throw PbException("File is in fail_archive_requests_test storage class, which always fails.");
+   }
+
    cta::common::dataStructures::ArchiveRequest request;
    checksum::ProtobufToChecksumBlob(notification.file().csb(), request.checksumBlob);
    request.diskFileInfo.owner_uid = notification.file().owner().uid();
-- 
GitLab