diff options
author | Diva Canto | 2017-05-01 14:58:03 -0700 |
---|---|---|
committer | Diva Canto | 2017-05-01 14:58:03 -0700 |
commit | 1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0 (patch) | |
tree | 997eaca547303eb70a4c0591b674044c9a435ebd /OpenSim/Tests/Permissions/DirectTransferTests.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0.zip opensim-SC-1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0.tar.gz opensim-SC-1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0.tar.bz2 opensim-SC-1ca2a7937ebf246bb2ebe4b1355f8068912ea4b0.tar.xz |
Permissions tests: added test with 2 direct transfers with permission changes in between (in inventory)
Diffstat (limited to 'OpenSim/Tests/Permissions/DirectTransferTests.cs')
-rw-r--r-- | OpenSim/Tests/Permissions/DirectTransferTests.cs | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/OpenSim/Tests/Permissions/DirectTransferTests.cs b/OpenSim/Tests/Permissions/DirectTransferTests.cs index e103d01..3ca711a 100644 --- a/OpenSim/Tests/Permissions/DirectTransferTests.cs +++ b/OpenSim/Tests/Permissions/DirectTransferTests.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Tests.Permissions | |||
48 | /// Basic scene object tests (create, read and delete but not update). | 48 | /// Basic scene object tests (create, read and delete but not update). |
49 | /// </summary> | 49 | /// </summary> |
50 | [TestFixture] | 50 | [TestFixture] |
51 | public class DirectTransferTests | 51 | public class DirectTransferTests |
52 | { | 52 | { |
53 | 53 | ||
54 | [SetUp] | 54 | [SetUp] |
@@ -57,15 +57,15 @@ namespace OpenSim.Tests.Permissions | |||
57 | } | 57 | } |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Test giving a C object. | 60 | /// Test giving simple objecta with various combinations of next owner perms. |
61 | /// </summary> | 61 | /// </summary> |
62 | [Test] | 62 | [Test] |
63 | public void TestGiveCBox() | 63 | public void TestGiveBox() |
64 | { | 64 | { |
65 | TestHelpers.InMethod(); | 65 | TestHelpers.InMethod(); |
66 | 66 | ||
67 | // C, CT, MC, MCT, MT, T | 67 | // C, CT, MC, MCT, MT, T |
68 | string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T"}; | 68 | string[] names = new string[6] { "Box C", "Box CT", "Box MC", "Box MCT", "Box MT", "Box T" }; |
69 | PermissionMask[] perms = new PermissionMask[6] { | 69 | PermissionMask[] perms = new PermissionMask[6] { |
70 | PermissionMask.Copy, | 70 | PermissionMask.Copy, |
71 | PermissionMask.Copy | PermissionMask.Transfer, | 71 | PermissionMask.Copy | PermissionMask.Transfer, |
@@ -108,5 +108,48 @@ namespace OpenSim.Tests.Permissions | |||
108 | 108 | ||
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | ||
112 | /// Test giving simple objecta with variour combinations of next owner perms. | ||
113 | /// </summary> | ||
114 | [Test] | ||
115 | public void TestDoubleGiveWithChange() | ||
116 | { | ||
117 | TestHelpers.InMethod(); | ||
118 | |||
119 | string name = "Box MCT-C"; | ||
120 | InventoryItemBase item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[0].UUID, "Objects", name); | ||
121 | |||
122 | // Now give the item to A2. We give the original item, not a clone. | ||
123 | // The giving methods are supposed to duplicate it. | ||
124 | Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[0], Common.TheAvatars[1]); | ||
125 | |||
126 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); | ||
127 | |||
128 | // Check the receiver | ||
129 | Common.TheInstance.PrintPerms(item); | ||
130 | Common.TheInstance.AssertPermissions(PermissionMask.Modify | PermissionMask.Transfer, | ||
131 | (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); | ||
132 | |||
133 | // --------------------------- | ||
134 | // Second transfer | ||
135 | //---------------------------- | ||
136 | |||
137 | // A2 revokes M | ||
138 | Common.TheInstance.RevokePermission(1, name, PermissionMask.Modify); | ||
139 | |||
140 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[1].UUID, "Objects", name); | ||
141 | |||
142 | // Now give the item to A3. We give the original item, not a clone. | ||
143 | // The giving methods are supposed to duplicate it. | ||
144 | Common.TheInstance.GiveInventoryItem(item.ID, Common.TheAvatars[1], Common.TheAvatars[2]); | ||
145 | |||
146 | item = Common.TheInstance.GetItemFromInventory(Common.TheAvatars[2].UUID, "Objects", name); | ||
147 | |||
148 | // Check the receiver | ||
149 | Common.TheInstance.PrintPerms(item); | ||
150 | Common.TheInstance.AssertPermissions(PermissionMask.Transfer, | ||
151 | (PermissionMask)item.BasePermissions, Common.TheInstance.IdStr(item)); | ||
152 | |||
153 | } | ||
111 | } | 154 | } |
112 | } \ No newline at end of file | 155 | } \ No newline at end of file |