syscalls/open11: new open(2) test case

In addition to existing open(2) tests, add more basic tests and make
sure open(2) works and handles error conditions correctly.

There are 28 test cases:
1. Open regular file O_RDONLY
2. Open regular file O_WRONLY
3. Open regular file O_RDWR
4. Open regular file O_RDWR | O_SYNC
5. Open regular file O_RDWR | O_TRUNC
6. Open dir O_RDONLY
7. Open dir O_RDWR, expect EISDIR
8. Open regular file O_DIRECTORY, expect ENOTDIR
9. Open hard link file O_RDONLY
10. Open hard link file O_WRONLY
11. Open hard link file O_RDWR
12. Open sym link file O_RDONLY
13. Open sym link file O_WRONLY
14. Open sym link file O_RDWR
15. Open sym link dir O_RDONLY
16. Open sym link dir O_WRONLY, expect EISDIR
17. Open sym link dir O_RDWR, expect EISDIR
18. Open device special file O_RDONLY
19. Open device special file O_WRONLY
20. Open device special file O_RDWR
21. Open non-existing regular file in existing dir
22. Open link file O_RDONLY | O_CREAT
23. Open symlink file O_RDONLY | O_CREAT
24. Open regular file O_RDONLY | O_CREAT
25. Open symlink dir O_RDONLY | O_CREAT, expect EISDIR
26. Open dir O_RDONLY | O_CREAT, expect EISDIR
27. Open regular file O_RDONLY | O_TRUNC, behaviour is undefined but
    should not oops or hang
28. Open regular file(non-empty) O_RDONLY | O_TRUNC, behaviour is
    undefined but should not oops or hang

Signed-off-by: Eryu Guan <eguan@redhat.com>
Acked-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
4 files changed