Commit Graph

226 Commits

Author SHA1 Message Date
Pat Hickey
17f43d4cc3 path_link test: we no longer support symlink following
just assert that setting the symlink following lookupflag gives an
ERRNO_INVAL.
2021-01-25 17:15:32 -08:00
Pat Hickey
8f4fecacdc interesting paths: loosen up errno requirements 2021-01-25 15:28:01 -08:00
Pat Hickey
996d49c81f nofollow test: permit ACCES as well as LOOP when opening with nofollow 2021-01-25 15:20:35 -08:00
Pat Hickey
144ca2f535 add a test of symlink happy path to isolate the windows failure 2021-01-25 15:14:26 -08:00
Pat Hickey
a8426125d2 kick the can 2021-01-25 14:56:58 -08:00
Pat Hickey
72b207de2e path_link: some improvements required by windows
* need to close the handle to the subdirectory before its legal to
  delete it
* windows doesnt give us a way to distinguish between an ERRNO_PERM and
  an ERRNO_ACCES, so lets accept either one
2021-01-25 14:35:02 -08:00
Pat Hickey
2c6bde5ee4 elaborate! 2021-01-25 12:54:13 -08:00
Pat Hickey
7fd3d58b23 enumerate windows test failures, move the file 2021-01-25 12:20:10 -08:00
Pat Hickey
634e911a4b tests: directory seeking is actually prohibited! but the test was wrong
* path_open of a directory without OFLAGS_DIRECTORY worked on linux,
  but fortunately not on windows!
* the errno is BADF instead of NOTCAPABLE for fd_seek on a directory
* no way for a directory to have the FD_SEEK right.
2021-01-25 12:13:02 -08:00
Pat Hickey
a46c2ad0aa split poll tests up, only one requires "real" stdio 2021-01-21 16:54:40 -08:00
Pat Hickey
12056885eb fix preopen dir to work on windows 2021-01-21 16:08:49 -08:00
Pat Hickey
16b42a5707 fix 2021-01-21 14:14:05 -08:00
Pat Hickey
f3e40e2fc4 restructure cap-std impls into their own crate 2021-01-20 19:09:15 -08:00
Pat Hickey
21713d3468 Revert "TEMPORARY: poll_oneoff test uses CLOCKID_REALTIME instead of MONOTONIC"
This reverts commit f667263d9c.
2021-01-19 14:57:10 -08:00
Pat Hickey
b84c4d7488 poll_oneoff test: if you subscribe to a badf, the whole call fails with badf
rather than the results telling you an individual file was a badf.

why? i think the old behavior was too clever, and makes it harder to
write a scheduler.

* what should the call do when you pass it some badf and some not-badf?
i don't think anything besides exiting early is the correct answer.
* the results vector tells you something that the scheduler had to say
about the file, not about your inputs. the errno of the function
always says what the validity of the inputs was
2021-01-14 17:41:27 -08:00
Pat Hickey
f667263d9c TEMPORARY: poll_oneoff test uses CLOCKID_REALTIME instead of MONOTONIC
the scheduler does not support the monotonic clock yet, i will fix this
soon
2021-01-14 17:40:56 -08:00
Pat Hickey
7d7acc4614 poll_oneoff test: outline assertions
this makes the panic message have the line number, which
is handy
2021-01-14 17:40:04 -08:00
Pat Hickey
9a1ce1a272 TEMPORARY: inherit stdio for the wasi ctx
this is unfortunate but the poll_oneoff test insists on polling on stdio
handles. to undo this temporary fix later, lets rewrite the test to open
some regular files from the scratch directory and poll on them instead.
2021-01-14 17:38:43 -08:00
Pat Hickey
e0e205f8d2 ctx builder: fix warnings, test harness 2021-01-13 11:07:06 -08:00
Pat Hickey
d56d2f0219 directory seek test: code does not agree with comment. Fix code.
the directory was opened with the seek right, and this test says that it
was asserting that the seek right was present. However, the test was
actually asserting that the seek right was *not* present.

This fixes the code of the test, because I believe the comment is
correct.
2021-01-11 17:58:32 -08:00
Pat Hickey
f084cf1fd0 failure to create trailing slash symlink to file can be EEXIST or ENOTDIR 2021-01-11 15:56:13 -08:00
Pat Hickey
09861c20db symlink-related tests: accept either ELOOP or ENOTDIR
when opening a symlink loop as directory, or nofollow opening a valid
symlink as directory.
2021-01-11 15:35:48 -08:00
Pat Hickey
4a6e92f52f upgrade to cap-std 0.9 2021-01-07 16:47:26 -08:00
Pat Hickey
a900d0431d Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-07 16:39:27 -08:00
Nick Fitzgerald
5ad82de3c5 Bump Wasmtime to 0.22.0; Cranelift to 0.69.0 2021-01-07 14:51:12 -08:00
Pat Hickey
222a57868e readlink: get rid of weird partial-buffer semantics carried over from posix
but follow posix in returning ERANGE when the result is too big
2021-01-04 16:41:24 -08:00
Pat Hickey
01d74ceb73 Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2021-01-04 11:19:02 -08:00
Pat Hickey
a33418c34a path_filestat: remove expectation that rights_inheriting describes subdirs
if inheriting rights are for files (not subdirs) then this is incorrect.

if inheriting rights are for subdirs too, then we need to change the
implementation.
2020-12-18 16:34:25 -08:00
Pat Hickey
f6afd4c41c test-programs: sandbox escape is an EPERM now, not an ENOTCAPABLE 2020-12-17 18:12:29 -08:00
Louis Pilfold
6bde8519c1 cargo deny config 2020-12-17 11:09:10 +00:00
Pat Hickey
dbe0f4f284 Revert "dangling_fd test: open with either READ or CREAT|WRITE"
fix for behavior in wasi-c2 coming in next commit

This reverts commit 789eec3827.
2020-12-16 15:54:46 -08:00
Pat Hickey
789eec3827 dangling_fd test: open with either READ or CREAT|WRITE
neither READ nor WRITE is an error
2020-12-16 15:16:14 -08:00
Pat Hickey
04805fcc5f pass a test, dubiously 2020-12-14 19:48:30 -08:00
Pat Hickey
c16e731455 get rid of linker Rc cycle, and add debug info to test programs 2020-12-14 17:15:03 -08:00
Pat Hickey
7ec9aac39f Merge remote-tracking branch 'origin/main' into pch/wasi_common_cap_std 2020-12-14 16:17:10 -08:00
Pat Hickey
1b8f9fd377 use virtual stdio
which works except for the lifetime issues, i think the trap still holds
an Rc to the store?
2020-12-11 18:22:13 -08:00
Pat Hickey
759455192b test-programs: learn how to preopen a dir again 2020-12-11 16:38:55 -08:00
Pat Hickey
dfcdbfd0fe test-programs: no longer test virtfs separately
wasi-c2 does not have a virtfs yet, and when it does we'll design a
better test harness

also fix prestat get: i was reporting the wrong error
2020-12-11 15:51:14 -08:00
Pat Hickey
d586574b1f port in args and env. slightly different style
building up a bunch of deferred errors in the CtxBuilder sucks. so does
reporting errors right away. Idk what to do here?
2020-12-11 15:33:59 -08:00
Pat Hickey
aef8be560f test-programs: use wasi-c2 instead of wasmtime 2020-12-11 15:00:58 -08:00
Dan Gohman
1d90c329b4 Remove an unused variable. 2020-12-11 10:52:54 -08:00
Dan Gohman
c3f0471ff2 Fix the return value from wasi-common's fd_readdir.
`fd_readdir` returns a "bufused" value, which indicates the number of
bytes read into the buffer. WASI libc expects this value to be equal
to the size of the buffer if the end of the directory has not yet
been scanned.

Previously, wasi-common's `fd_readdir` was writing as many complete
entries as it could fit and then stopping, but this meant it was
returning size less than the buffer size even when the directory had
more entries. This patch makes it continue writing up until the end
of the buffer, and return that number of bytes, to let WASI libc
know that there's more to be read.

Fixes #2493.
2020-12-11 10:52:54 -08:00
Alex Crichton
ab1958434a Bump to 0.21.0 (#2359) 2020-11-05 09:39:53 -06:00
Andrew Brown
6ebbab61b9 Update cfg-if dependency 2020-10-23 16:50:51 -07:00
Joshua Warner
d947010181 Don't implicitly create empty files in VirtualDir::openat (#2235)
* Don't implicitly create empty files in VirtualDir::openat

* Add test

* Add note on how to run test-program tests to the README
2020-09-25 19:52:13 -07:00
Alex Crichton
5e08eb3b83 Bump wasmtime to 0.20.0 (#2222)
At the same time bump cranelift crates to 0.67.0
2020-09-23 13:54:02 -05:00
Joshua Nelson
d28abad441 Upgrade to target-lexicon 0.11
This allows downstream library users to use `CDataModel` without having
to install two different versions of target-lexicon.
2020-09-15 11:40:09 -07:00
Pat Hickey
bacf470a3e bump all wat dependencies to 1.0.23
this gets us down to one version of `wast` in dependency tree!
2020-08-17 16:03:35 -07:00
Daiki Ueno
e70f73211d virtfs file: update cursor position on fd_read (#2070)
* virtfs file: update cursor position on fd_read

If a handle is backed by InMemoryFile, fd_read (turned into
Handle::read_vectored) doesn't update the cursor position properly and
thus prevents the caller from detecting EOF.

* virtfs file: fd_{pread,pwrite}: update offset in iovec iteration

If multiple iovec's are supplied, fd_pread and fd_pwrite previously
access data at the same offset for each iovec.
2020-07-29 14:19:17 +02:00
Alex Crichton
63d5b91930 Wasmtime 0.19.0 and Cranelift 0.66.0 (#2027)
This commit updates Wasmtime's version to 0.19.0, Cranelift's version to
0.66.0, and updates the release notes as well.
2020-07-16 12:46:21 -05:00