public virtual void TestXAttrOnMountEntry() { // Set XAttrs on the first namespace and verify they are correct fcView.SetXAttr(mountOnNn1, name1, value1); fcView.SetXAttr(mountOnNn1, name2, value2); NUnit.Framework.Assert.AreEqual(2, fcView.GetXAttrs(mountOnNn1).Count); Assert.AssertArrayEquals(value1, fcView.GetXAttr(mountOnNn1, name1)); Assert.AssertArrayEquals(value2, fcView.GetXAttr(mountOnNn1, name2)); // Double-check by getting the XAttrs using FileSystem // instead of ViewFs Assert.AssertArrayEquals(value1, fc.GetXAttr(targetTestRoot, name1)); Assert.AssertArrayEquals(value2, fc.GetXAttr(targetTestRoot, name2)); // Paranoid check: verify the other namespace does not // have XAttrs set on the same path. NUnit.Framework.Assert.AreEqual(0, fcView.GetXAttrs(mountOnNn2).Count); NUnit.Framework.Assert.AreEqual(0, fc2.GetXAttrs(targetTestRoot2).Count); // Remove the XAttr entries on the first namespace fcView.RemoveXAttr(mountOnNn1, name1); fcView.RemoveXAttr(mountOnNn1, name2); NUnit.Framework.Assert.AreEqual(0, fcView.GetXAttrs(mountOnNn1).Count); NUnit.Framework.Assert.AreEqual(0, fc.GetXAttrs(targetTestRoot).Count); // Now set XAttrs on the second namespace fcView.SetXAttr(mountOnNn2, name1, value1); fcView.SetXAttr(mountOnNn2, name2, value2); NUnit.Framework.Assert.AreEqual(2, fcView.GetXAttrs(mountOnNn2).Count); Assert.AssertArrayEquals(value1, fcView.GetXAttr(mountOnNn2, name1)); Assert.AssertArrayEquals(value2, fcView.GetXAttr(mountOnNn2, name2)); Assert.AssertArrayEquals(value1, fc2.GetXAttr(targetTestRoot2, name1)); Assert.AssertArrayEquals(value2, fc2.GetXAttr(targetTestRoot2, name2)); fcView.RemoveXAttr(mountOnNn2, name1); fcView.RemoveXAttr(mountOnNn2, name2); NUnit.Framework.Assert.AreEqual(0, fcView.GetXAttrs(mountOnNn2).Count); NUnit.Framework.Assert.AreEqual(0, fc2.GetXAttrs(targetTestRoot2).Count); }
/// <exception cref="System.IO.IOException"/> public override byte[] GetXAttr(Path path, string name) { return(fc.GetXAttr(path, name)); }
/// <exception cref="System.IO.IOException"/> public virtual void TestInternalGetXAttr() { fcView.GetXAttr(new Path("/internalDir"), "xattrName"); }