Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

424 lines
15 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. sharedlg.ut
  7. Share dialogs ( Create share, stop share, edit share ) unit tests
  8. There are three main dialogs in share subsystem: the "Share Properties"
  9. Dialog ( for changing properties of a share), the "Share Directory"
  10. Dialog ( for creating a new share) and the "Stop Sharing Directory"
  11. Dialog ( for stopping a share). The Share Properties dialog will
  12. be slightly different depending on whether the share is on a share-
  13. level server or a user-level server. If the share is on a user-level
  14. server, then additional properties of a share such as password and
  15. permissions are shown.
  16. The "Share Properties" dialog is invoked though the File Manager
  17. File Properties Dialog and then clicking the Share button. The
  18. other two dialogs are invoked through the Network Menu of the File
  19. Manager.
  20. FILE HISTORY:
  21. Yi-HsinS 17-Oct-1991 Created
  22. Yi-HsinS 18-Oct-1991 Added Platform and Code Work for NT machines
  23. */
  24. Platforms
  25. =========
  26. Win3.1/ LM20c Client
  27. OS2 1.21/ LM20c Server
  28. Code Work ==> We need to add the test for NT machines later
  29. Unit Tests
  30. ===========
  31. (1) Log on to the network.
  32. (2) Do a net use to two shares on different servers ( a user-level
  33. server and the other a share-level server ).
  34. Assume you did a net use to the following:
  35. (a) net use x: \\foo1\bar1 ( \\foo1 is a user-level server )
  36. (b) net use y: \\foo2\bar2 ( \\foo2 is a share-level server )
  37. (3) Bring up the File Manager.
  38. Share Properties Dialogs ( User-level and share-level )
  39. ========================
  40. Scenario 0
  41. ----------
  42. Click on a file ( not a directory ) in the any window:
  43. Expect:
  44. There should not be a button call "Share".
  45. There should be a "Files Opens..." button instead.
  46. Scenario 1
  47. -----------
  48. Assuming you are on a DOS machine which cannot be a server and
  49. hence, the directories could not possibly be shared.
  50. Click on a directory or file in the File window of local drive c:
  51. Click the File menu, Properties, Share
  52. Expect:
  53. MsgPopup saying "This operation is not supported on workstations."
  54. Scenario 2
  55. ----------
  56. Click on a directory that you know is not shared in either the
  57. File window or Directory Tree window of x:, y: or c: if local
  58. is an NT server.
  59. Click the File menu, Properties, Share
  60. Expect:
  61. MsgPopup saying "The directory you selected is not shared."
  62. Scenario 3 ( Assume you have admin privilege on user-level server \\foo1 )
  63. ----------
  64. Click on a directory that you know is shared in either the
  65. File window or Directory Tree window of x: ( \\foo1 , user-level server )
  66. or c: is local is an NT user-level server.
  67. Click the File menu, Properties, Share
  68. Expect:
  69. Caption of the dialog = "Share Properties".
  70. Focus on listbox "Share Name". There should be at least
  71. one share name in the listbox and the first one is
  72. highlighted.
  73. The comment and magic group User Limit both displays info.
  74. on the share name that is highlighted.
  75. Click any other share name besides the one highlighted in the listbox
  76. ( if there exists! )
  77. Expect:
  78. Focus is now on the share name selected.
  79. The comment and the user limit is updated to reflect the info.
  80. on the share name that is selected.
  81. Change the comment. Click on the spin button to change the user limit or
  82. click on the unlimited radio button.
  83. Click OK.
  84. Expect:
  85. Dialog should be dismissed and we return to the File Properties
  86. dialog.
  87. Click on Share button again.
  88. Click on the share name that you have changed the comment and user limit
  89. earlier.
  90. Expect:
  91. The comment and user limit should reflect the info. you typed
  92. in earlier.
  93. Scenario 4 ( Assume you don't have admin privilege on user-level server
  94. ------------
  95. but you have another password that does have admin privilege
  96. because maybe you are on a different domain)
  97. Click on a directory that you know is shared in either the
  98. File window or Directory Tree window of x: ( \\foo1, user-level server )
  99. or c: if local machine is a NT user-level server.
  100. Click the File menu, Properties, Share
  101. Expect:
  102. A dialog with caption "Enter Password" shows up prompting
  103. you for the password to the resource \\foo1\admin$.
  104. ( This may change in the future where you may be able
  105. to type in a different user name. )
  106. Type in your password with admin privilege.
  107. If the password you typed in indeed gives you admin privilege, the
  108. rest of the scenario is the same as scenario 3.
  109. You should verify that you indeed have a connection made to \\foo1\admin$
  110. when the "Share Properties" dialog still exists.
  111. The connection should be deleted once the "Share Properties" dialog is
  112. dismissed.
  113. Otherwise, there would be a MsgPopup saying "Insufficient privilege."
  114. Scenario 5 (Assume your password is the same as the share \\foo2\admin$
  115. ------------
  116. on a share-level server )
  117. Click on a directory that you know is shared in either the
  118. File window or Directory Tree window of y: ( \\foo2, share-level server )
  119. or c: if local machine is a NT share-level server.
  120. Click the File menu, Properties, Share
  121. Same as scenario 3 except the dialog has addition properties of the
  122. share that you can change, the password field and the magic group
  123. Permissions.
  124. Scenario 6 ( Assume your password is not the same as \\foo2\admin$ on
  125. ------------
  126. on a share-level server )
  127. Click on a directory that you know is shared in either the
  128. File window or Directory Tree window of y: ( \\foo2, share-level server )
  129. or c: if local machine is a NT share-level server.
  130. Click the File menu, Properties, Share
  131. Expect:
  132. A dialog with caption "Enter Password" shows up prompting
  133. you for the password to the resource \\foo2\admin$.
  134. Type in the password for admin share.
  135. If the password you typed in is correct, the rest of the scenario
  136. is the same as scenario 5.
  137. You should verify that you indeed have a connection made to \\foo2\admin$
  138. when the "Share Properties" dialog still exists.
  139. The connection should be deleted once the "Share Properties" dialog is
  140. dismissed.
  141. Otherwise, there would be a MsgPopup saying "Insufficient privilege."
  142. Scenario 7 ( with admin priv. either on a user or share level server )
  143. ----------
  144. Click on a directory that you know is shared in either the
  145. File window or Directory Tree window of x: or y:
  146. or c: if local machine is a NT share-level server.
  147. Click the File menu, Properties, Share
  148. Let's assume the listbox shows 3 share names
  149. share1, share2, share3.
  150. The original focus is on the first share name assuming share1.
  151. Delete share3 on the server that you chose.
  152. If you clicked on share3 now, since it does not exist any more,
  153. there will be a
  154. MsgPopup saying "This shared resource does not exist."
  155. And the focus will be on the first share name in the listbox
  156. that we can get info. on, and hence the comment, user limit,
  157. password, permissions will contain info. on the share that
  158. is highlighted.
  159. Share Directory Dialog ( Create a new share dialog )
  160. =======================
  161. Scenario 0 ( on a user-level server )
  162. -----------
  163. Click on a directory or file in either the File window or
  164. Directory Tree window of x:
  165. or c: if local machine is a NT user-level server.
  166. If a file is selected, the directory containing the file is
  167. used instead.
  168. Click the Network menu, Share Directory.
  169. Expect:
  170. The Share Directory has a default name which is
  171. the UNC name of the directory that is selected in the
  172. File Manager. If multiple dirs are selected, the UNC
  173. name of the first directory is shown.
  174. The Share Name has a default name which is the name
  175. of the selected directory. If multiple dirs are
  176. selected, the name of the first directory is shown.
  177. You are free to type in the UNC name of any directory
  178. you want to share or any share name. ( Assume the
  179. Share Directory you typed in is a still on a user-level
  180. server )
  181. Type the comment, change the user limit if you feel like it.
  182. Click OK.
  183. Assume the Share Directory you typed in name is a user-level server.
  184. Expect:
  185. If you don't have admin privilege, a dialog with caption
  186. "Enter Password" popups and you will be prompted
  187. for the password to the \\server\admin$. Type in the
  188. password if this happens or hit cancel will return you
  189. back to the Share Directory dialog.
  190. If you type in the correct password, a connection will be
  191. made to \\server\admin$. The connection should be deleted
  192. once the share is created successfully. You should
  193. verify that there is no connection to \\server\admin$ once
  194. the dialog is dismissed.
  195. If no MsgPopup, the share should be created successfully.
  196. You can use the Share Properties Dialog to view if
  197. all the info. are set correctly.
  198. Otherwise, if some error occurs, the error is shown and
  199. you can correct the info. on the dialog and click OK
  200. again. You can choose to cancel the dialog if it's not
  201. possible to create the share.
  202. Scenario 1 ( on a share-level server )
  203. ------------
  204. Click on a directory or file in either the File window or
  205. Directory Tree window of y:
  206. or c: if local machine is a NT share-level server.
  207. If a file is selected, the directory containing the file is
  208. used instead.
  209. Click the Network menu, Share Directory.
  210. Expect:
  211. The Share Directory has a default name which is
  212. the UNC name of the directory that is selected in the
  213. File Manager. If multiple dirs are selected, the UNC
  214. name of the first directory is shown.
  215. The Share Name has a default name which is the name
  216. of the selected directory. If multiple dirs are
  217. selected, the name of the first directory is shown.
  218. You are free to type in the UNC name of any directory
  219. you want to share or any share name. ( Assume the
  220. Share Directory you typed in is a still on a share-level
  221. server )
  222. Type the comment, change the user limit if you feel like it.
  223. Click OK.
  224. Expect:
  225. If you don't have admin privilege, a dialog with caption
  226. "Enter Password" popups and you will be prompted
  227. for the password to the \\server\admin$. Type in the
  228. password if this happens or hit cancel will return you
  229. back to the Share Directory dialog.
  230. If you type in the correct password, a connection will be
  231. made to \\server\admin$. The connection should be deleted
  232. once the share is created successfully. You should
  233. verify that there is no connection to \\server\admin$ once
  234. the dialog is dismissed.
  235. Because you are on a share-level server, a dialog with
  236. caption "Password for New Share" pops up prompting
  237. for the password and permissions to the share you are
  238. creating.
  239. Type in the password, set the permissions and Click OK.
  240. Expect:
  241. If you type in an invalid password or an invalid permission,
  242. the focus will be set on the field which is invalid. If
  243. you type in the valid password or permissions, the dialog
  244. will be dismissed and the share will be created if no error
  245. occurs. If you choose to hit CANCEL, then you are returned
  246. to the the Share Directory Dialog in which you may want to
  247. change some fields.
  248. Scenario 2
  249. ----------
  250. Click on a directory in either the File window or
  251. Directory Tree window of x: or y:
  252. or c: if local machine is a DOS machine which is not a server.
  253. Click the Network menu, Share Directory.
  254. Expect:
  255. If some error occurs while the default Share Directory
  256. or Share name is sought, a MsgPopup saying that
  257. "The share directory of the selected directory could
  258. not be shown. Error errno occurred: text of errno".
  259. After clicking OK for the MsgPopup, the Share Directory
  260. Dialog pops up and the Share directory SLE and Share Name
  261. SLE will be empty. You can type in any Share directory
  262. and share name you want.
  263. Stop Sharing Dialog
  264. ====================
  265. Scenario 0
  266. ----------
  267. Click on a directory or file in any window of the File Manager.
  268. If a file is selected, the directory containing the file is
  269. used instead.
  270. Click the Network menu, Stop Sharing Directory.
  271. Expect:
  272. The Share Name has a default name which is
  273. the UNC name of the directory that is selected in the
  274. File Manager. If multiple dirs are selected, the UNC
  275. name of the first directory is shown. If the directory
  276. you selected have multiple share names, all the share
  277. names are shown in the combobox. You are free to click
  278. any name in the combobox or type in the UNC share name
  279. of any directory you want to stop share.
  280. Click OK.
  281. Expect:
  282. If you don't have admin privilege, a dialog with caption
  283. "Enter Password" popups and you will be prompted
  284. for the password to the \\server\admin$. Type in the
  285. password if this happens or hit cancel will return you
  286. back to the Share Directory dialog.
  287. If you type in the correct password, a connection will be
  288. made to \\server\admin$. The connection should be deleted
  289. once the share is deleted successfully. You should
  290. verify that there is no connection to \\server\admin$ once
  291. the dialog is dismissed.
  292. If any error occurs while deleting the share, there
  293. will be a MsgPopup stating the error and you are returned
  294. to the Stop Sharing dialog.
  295. If there are any user using the share that you are going
  296. to delete, a warning dialog pops up showing all
  297. the usernames, #file opens and the elapsed time since the user
  298. connected to the share. Clicking OK will delete the
  299. share and Cancel will return you back to the Stop Sharing
  300. Dialog.
  301. Scenario 1
  302. ----------
  303. Click on a directory in either the File window or
  304. Directory Tree window of x: or y:
  305. or c: if local machine is a DOS machine which is not a server.
  306. Click the Network menu, Share Directory.
  307. Expect:
  308. If some error occurs while the default Share Directory
  309. or Share name is sought, a MsgPopup saying that
  310. "The share directory of the selected directory could
  311. not be shown. Error errno occurred: text of errno".
  312. After clicking OK for the MsgPopup, the Stop Sharing
  313. Dialog pops up and the Share Name combobox is empty.
  314. You can type in any Share name you want to delete.