Repository: Azure/azure-data-lake-store-python

Issue:
SetOwner and SetPermission are now supported, need tests
Please add tests and recordings for these two APIs now that they are supported

Discussion:

Patch:
diff --git a/adlfs/cli.py b/adlfs/cli.py
index f8d2a1f..320033f 100644
--- a/adlfs/cli.py
+++ b/adlfs/cli.py
@@ -91,13 +91,13 @@ class AzureDataLakeFSCommand(cmd.Cmd, object):
 
     def _parse_ownership(self, ownership):
         if ':' in ownership:
-            user, group = ownership.split(':')
-            if not user:
-                user = None
+            owner, group = ownership.split(':')
+            if not owner:
+                owner = None
         else:
-            user = ownership
+            owner = ownership
             group = None
-        return user, group
+        return owner, group
 
     def do_chown(self, line):
         parser = argparse.ArgumentParser(prog="chown", add_help=False)
@@ -105,10 +105,10 @@ class AzureDataLakeFSCommand(cmd.Cmd, object):
         parser.add_argument('files', type=str, nargs='+')
         args = parser.parse_args(line.split())
 
-        user, group = self._parse_ownership(args.ownership)
+        owner, group = self._parse_ownership(args.ownership)
 
         for f in args.files:
-            self._fs.chown(f, user=user, group=group)
+            self._fs.chown(f, owner=owner, group=group)
 
     def help_chown(self):
         print("chown owner[:group] file ...")


Test patch:
diff --git a/tests/recordings/test_cli/test_chgrp.yaml b/tests/recordings/test_cli/test_chgrp.yaml
new file mode 100644
index 0000000..5a4b97d
--- /dev/null
+++ b/tests/recordings/test_cli/test_chgrp.yaml
@@ -0,0 +1,113 @@
+interactions:
+- request:
+    body: '123456'
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['6']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?overwrite=true&write=true&OP=CREATE
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      ContentLength: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:35 GMT']
+      Expires: ['-1']
+      Location: ['https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?overwrite=true&write=true&OP=CREATE']
+      Pragma: [no-cache]
+      Server-Perf: ['[bd1d8cd5-2d95-4f5f-8a53-2c3d201e18a6][ AuthTime::916.891327850232::PostAuthTime::207.840105100379
+          ][S-HdfsGetFileStatusV2 :: 00:00:005 ms]%0a[S-HdfsCheckAccess :: 00:00:002
+          ms]%0a[S-FsDelete :: 00:00:005 ms]%0a[S-FsOpenStream :: 00:00:061 ms]%0a[S-FsAppendStream
+          :: 00:00:147 ms]%0a[BufferingTime :: 00:00:000 ms]%0a[WriteTime :: 00:00:147
+          ms]%0a[S-FsAppendStream :: 00:00:034 ms]%0a[S-FsCloseHandle :: 00:00:001
+          ms]%0a[CREATE :: 00:00:268 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [bd1d8cd5-2d95-4f5f-8a53-2c3d201e18a6]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 201, message: Created}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?group=foo&OP=SETOWNER
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:35 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[ad84325f-4c08-46a9-bb80-de4087dec9c1][ AuthTime::862.151547083054::PostAuthTime::171.917123971919
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [ad84325f-4c08-46a9-bb80-de4087dec9c1]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.11.1]
+    method: GET
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo?OP=LISTSTATUS
+  response:
+    body: {string: '{"FileStatuses":{"FileStatus":[{"length":6,"pathSuffix":"bar","type":"FILE","blockSize":268435456,"accessTime":1475122175622,"modificationTime":1475122175761,"replication":1,"permission":"770","owner":"49b2f9ec-818a-49ca-9424-249e1f19f7d7","group":"49b2f9ec-818a-49ca-9424-249e1f19f7d7"}]}}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['290']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:09:35 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[886a16e5-6b2d-4dc4-ae05-51f0e7426d8a][ AuthTime::990.876410298956::PostAuthTime::215.538071122432
+          ][S-HdfsListStatus :: 00:00:031 ms]%0a[LISTSTATUS :: 00:00:031 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [886a16e5-6b2d-4dc4-ae05-51f0e7426d8a]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: DELETE
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?recursive=False&OP=DELETE
+  response:
+    body: {string: '{"boolean":true}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['16']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:09:36 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[ba03af52-3d38-43d3-b915-87fe720fe72b][ AuthTime::844.619155876924::PostAuthTime::280.969511600577
+          ][S-FsDelete :: 00:00:083 ms]%0a[DELETE :: 00:00:091 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [ba03af52-3d38-43d3-b915-87fe720fe72b]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+version: 1
diff --git a/tests/recordings/test_cli/test_chown.yaml b/tests/recordings/test_cli/test_chown.yaml
new file mode 100644
index 0000000..9b1b17c
--- /dev/null
+++ b/tests/recordings/test_cli/test_chown.yaml
@@ -0,0 +1,165 @@
+interactions:
+- request:
+    body: '123456'
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['6']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?overwrite=true&write=true&OP=CREATE
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      ContentLength: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:36 GMT']
+      Expires: ['-1']
+      Location: ['https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?overwrite=true&write=true&OP=CREATE']
+      Pragma: [no-cache]
+      Server-Perf: ['[a70cb23e-2849-41d0-92d6-ecd4f18309d6][ AuthTime::982.749286031361::PostAuthTime::208.26758150447
+          ][S-HdfsGetFileStatusV2 :: 00:00:006 ms]%0a[S-HdfsCheckAccess :: 00:00:002
+          ms]%0a[S-FsDelete :: 00:00:005 ms]%0a[S-FsOpenStream :: 00:00:036 ms]%0a[S-FsAppendStream
+          :: 00:00:196 ms]%0a[BufferingTime :: 00:00:000 ms]%0a[WriteTime :: 00:00:196
+          ms]%0a[S-FsAppendStream :: 00:00:033 ms]%0a[S-FsCloseHandle :: 00:00:001
+          ms]%0a[CREATE :: 00:00:296 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [a70cb23e-2849-41d0-92d6-ecd4f18309d6]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 201, message: Created}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?owner=foo&OP=SETOWNER
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:37 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[87b33574-03ce-45bb-97fd-5c35cae5c524][ AuthTime::945.117335675742::PostAuthTime::220.66992995868
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [87b33574-03ce-45bb-97fd-5c35cae5c524]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?group=foo&OP=SETOWNER
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:37 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[bfe54b19-e547-4b94-a69d-f8bcee43e4c8][ AuthTime::932.288884678858::PostAuthTime::213.400070392087
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [bfe54b19-e547-4b94-a69d-f8bcee43e4c8]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?group=foo&owner=foo&OP=SETOWNER
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:09:37 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[bba612c2-e2c2-480f-b7f9-4883970dc590][ AuthTime::1009.26643436432::PostAuthTime::203.13625267926
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [bba612c2-e2c2-480f-b7f9-4883970dc590]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.11.1]
+    method: GET
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo?OP=LISTSTATUS
+  response:
+    body: {string: '{"FileStatuses":{"FileStatus":[{"length":6,"pathSuffix":"bar","type":"FILE","blockSize":268435456,"accessTime":1475122177420,"modificationTime":1475122177607,"replication":1,"permission":"770","owner":"49b2f9ec-818a-49ca-9424-249e1f19f7d7","group":"49b2f9ec-818a-49ca-9424-249e1f19f7d7"}]}}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['290']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:09:38 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[590d1d73-6cab-46a8-b06f-559563296587][ AuthTime::907.482928030873::PostAuthTime::203.563559727943
+          ][S-HdfsListStatus :: 00:00:011 ms]%0a[LISTSTATUS :: 00:00:012 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [590d1d73-6cab-46a8-b06f-559563296587]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: DELETE
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/foo/bar?recursive=False&OP=DELETE
+  response:
+    body: {string: '{"boolean":true}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['16']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:09:38 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[83093651-8421-45c0-a12d-468c16ec2267][ AuthTime::990.019830332411::PostAuthTime::239.058784084587
+          ][S-FsDelete :: 00:00:095 ms]%0a[DELETE :: 00:00:103 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [83093651-8421-45c0-a12d-468c16ec2267]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+version: 1
diff --git a/tests/recordings/test_core/test_chown.yaml b/tests/recordings/test_core/test_chown.yaml
new file mode 100644
index 0000000..aa4693e
--- /dev/null
+++ b/tests/recordings/test_core/test_chown.yaml
@@ -0,0 +1,164 @@
+interactions:
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=CREATE&overwrite=true&write=true
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      ContentLength: ['0']
+      Date: ['Thu, 29 Sep 2016 03:59:59 GMT']
+      Expires: ['-1']
+      Location: ['https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=CREATE&overwrite=true&write=true']
+      Pragma: [no-cache]
+      Server-Perf: ['[d869d515-b22a-4605-ac9e-4e0f7c5b6d8c][ AuthTime::897.647641440444::PostAuthTime::207.840282868059
+          ][S-HdfsGetFileStatusV2 :: 00:00:006 ms]%0a[S-HdfsCheckAccess :: 00:00:002
+          ms]%0a[S-FsDelete :: 00:00:006 ms]%0a[S-FsOpenStream :: 00:00:044 ms]%0a[BufferingTime
+          :: 00:00:000 ms]%0a[WriteTime :: 00:00:000 ms]%0a[S-FsAppendStream :: 00:00:027
+          ms]%0a[S-FsCloseHandle :: 00:00:001 ms]%0a[CREATE :: 00:00:096 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [d869d515-b22a-4605-ac9e-4e0f7c5b6d8c]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 201, message: Created}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      User-Agent: [python-requests/2.11.1]
+    method: GET
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir?OP=LISTSTATUS
+  response:
+    body: {string: '{"FileStatuses":{"FileStatus":[{"length":0,"pathSuffix":"a","type":"FILE","blockSize":268435456,"accessTime":1475121600130,"modificationTime":1475121600130,"replication":1,"permission":"770","owner":"49b2f9ec-818a-49ca-9424-249e1f19f7d7","group":"49b2f9ec-818a-49ca-9424-249e1f19f7d7"}]}}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['288']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:00:00 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[b7c2f7c8-7e37-46e8-8332-33364ce07654][ AuthTime::909.193157359269::PostAuthTime::209.122979279719
+          ][S-HdfsListStatus :: 00:00:011 ms]%0a[LISTSTATUS :: 00:00:012 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [b7c2f7c8-7e37-46e8-8332-33364ce07654]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=SETOWNER&owner=foo
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:00:00 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[c9893c0b-74c5-4731-9d7e-30d5438e89bb][ AuthTime::1052.88411988168::PostAuthTime::266.856088873341
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [c9893c0b-74c5-4731-9d7e-30d5438e89bb]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=SETOWNER&group=bar
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:00:00 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[9847e1b4-5dbd-42ca-974e-9dd95db3f30a][ AuthTime::0::PostAuthTime::0
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [9847e1b4-5dbd-42ca-974e-9dd95db3f30a]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: PUT
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=SETOWNER&owner=foo&group=bar
+  response:
+    body: {string: ''}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['0']
+      Date: ['Thu, 29 Sep 2016 04:00:01 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[5e3ddf51-8148-4d3b-a582-5f48a8ba63a9][ AuthTime::946.399490920039::PostAuthTime::216.393195845251
+          ][SETOWNER :: 00:00:000 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [5e3ddf51-8148-4d3b-a582-5f48a8ba63a9]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+- request:
+    body: null
+    headers:
+      Accept: ['*/*']
+      Accept-Encoding: ['gzip, deflate']
+      Connection: [keep-alive]
+      Content-Length: ['0']
+      User-Agent: [python-requests/2.11.1]
+    method: DELETE
+    uri: https://fakestore.azuredatalakestore.net/webhdfs/v1/azure_test_dir/a?OP=DELETE&recursive=True
+  response:
+    body: {string: '{"boolean":true}'}
+    headers:
+      Cache-Control: [no-cache]
+      Content-Length: ['16']
+      Content-Type: [application/json; charset=utf-8]
+      Date: ['Thu, 29 Sep 2016 04:00:01 GMT']
+      Expires: ['-1']
+      Pragma: [no-cache]
+      Server-Perf: ['[b928f672-0d84-4a07-9932-55e7b00d2e3f][ AuthTime::1142.69292351484::PostAuthTime::316.892012097492
+          ][S-FsDelete :: 00:00:073 ms]%0a[DELETE :: 00:00:082 ms]%0a']
+      Status: ['0x0']
+      Strict-Transport-Security: [max-age=15724800; includeSubDomains]
+      X-Content-Type-Options: [nosniff]
+      x-ms-request-id: [b928f672-0d84-4a07-9932-55e7b00d2e3f]
+      x-ms-webhdfs-version: [16.07.18.01]
+    status: {code: 200, message: OK}
+version: 1
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 20b84f3..1b14260 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -55,6 +55,13 @@ def test_cat(capsys, azure, client):
         assert read_stdout(capsys) == '123456'
 
 
+@my_vcr.use_cassette
+def test_chgrp(capsys, azure, client):
+    with setup_file(azure) as azurefile:
+        client.onecmd('chgrp foo ' + azurefile)
+        assert not read_stdout(capsys)
+
+
 @my_vcr.use_cassette
 def test_chmod(capsys, azure, client):
     with setup_file(azure) as azurefile:
@@ -68,6 +75,19 @@ def test_chmod(capsys, azure, client):
         assert 'permission       = 550' in read_stdout(capsys)
 
 
+@my_vcr.use_cassette
+def test_chown(capsys, azure, client):
+    with setup_file(azure) as azurefile:
+        client.onecmd('chown foo ' + azurefile)
+        assert not read_stdout(capsys)
+
+        client.onecmd('chown :foo ' + azurefile)
+        assert not read_stdout(capsys)
+
+        client.onecmd('chown foo:foo ' + azurefile)
+        assert not read_stdout(capsys)
+
+
 @my_vcr.use_cassette
 def test_df(capsys, azure, client):
     client.onecmd('df')
diff --git a/tests/test_core.py b/tests/test_core.py
index 8c6216f..a986219 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -605,6 +605,27 @@ def test_chmod(azure):
         azure.chmod(test_dir / 'deep', '770')
 
 
+@my_vcr.use_cassette
+def test_chown(azure):
+    with azure_teardown(azure):
+        azure.touch(a)
+
+        # Account doesn't have permission to change owner
+        owner = azure.info(a)['owner']
+        azure.chown(a, owner='foo')
+        assert owner == azure.info(a)['owner']
+
+        # Account doesn't have permission to change group
+        group = azure.info(a)['group']
+        azure.chown(a, group='bar')
+        assert group == azure.info(a)['group']
+
+        # Account doesn't have permission to change owner/group
+        azure.chown(a, owner='foo', group='bar')
+        assert owner == azure.info(a)['owner']
+        assert group == azure.info(a)['group']
+
+
 @pytest.mark.skipif(sys.platform != 'win32', reason="requires windows")
 def test_backslash():
     from adlfs.core import AzureDLPath