You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Testing and Debugging](https://github.com/Lind-Project/lind-docs/blob/main/docs/RustPOSIX/Testing-and-Debugging.md)
14
12
15
-
## Run RustPOSIX-Rust
13
+
## Overview
14
+
This document provides a step-by-step guide to access the NYU SSH server and run Docker commands to set up and test the Lind project. If you face issues while accessing the server, troubleshooting steps are included to help you resolve them efficiently.
15
+
16
+
## Accessing the SSH Server
17
+
### SSH Command Format
18
+
To gain access, use the following SSH command format:
19
+
20
+
```bash
21
+
[username]@lind-server.engineering.nyu.edu
22
+
```
23
+
24
+
**Description**: Replace `[username]` with your NYU username to connect to the Lind server. This command will initiate a secure shell connection to the server, allowing you to work on the remote system.
25
+
26
+
### Troubleshooting Access Issues
27
+
#### Permission Denied
28
+
-**Description**: This usually means that the password is incorrect. Please try to recall the correct password or contact seniors for assistance, or ask for help in the Slack channel.
To verify network connectivity, follow these steps:
39
+
40
+
1.**Are you on an on-campus network?**
41
+
42
+

43
+
44
+
2. If connected but still unable to access, contact seniors or use the Slack channel for support.
45
+
46
+
3. If not connected to the on-campus network, connect to VPN via the [NYU VPN Guide](https://www.nyu.edu/life/information-technology/infrastructure/network-services/vpn.html).
47
+
48
+
## Running Docker
49
+
### Running the Docker Container
50
+

51
+
52
+
Once you have SSH access, run the Docker container with the following command:
53
+
54
+
```bash
55
+
docker run --privileged --ipc=host --cap-add=SYS_PTRACE -it securesystemslab/lind /bin/bash
56
+
```
57
+
58
+
**Description**: This command starts a Docker container using the image `securesystemslab/lind`. The options used are:
59
+
60
+
-`--privileged`: Grants extended privileges to the container.
61
+
-`--ipc=host`: Allows the container to share the host’s IPC namespace, enabling shared memory.
62
+
-`--cap-add=SYS_PTRACE`: Adds the capability to use `ptrace`, which is helpful for debugging.
63
+
-`-it`: Opens an interactive terminal session.
64
+
-`/bin/bash`: Launches a Bash shell inside the container.
65
+
66
+
**Note**: This command will give you an interactive shell inside the Docker container where you can run other commands.
67
+
68
+
## Next Steps After Running Docker
69
+
### Checking Git Branch and Updating
70
+
Once inside the container:
71
+
72
+
1.**Ensure you are on the `develop` branch**. Run the following commands to check and update:
73
+
74
+
```bash
75
+
git branch
76
+
```
77
+
78
+
**Description**: Displays the current branch. Ensure that you are on the `develop` branch.
79
+
80
+
```bash
81
+
git pull
82
+
```
83
+
84
+
**Description**: Fetches the latest updates from the remote repository and merges them into your current branch.
85
+
86
+
### Building Lind
87
+
1. **Update Contents**:
88
+
- Run the following command to update contents to the newest version:
89
+
90
+
```bash
91
+
make -2
92
+
```
93
+
94
+
**Description**: This command will ensure that all the components are updated to the latest version. The `make`command runs the instructions defined in the Makefile, and the `-2` argument here specifies a particular target or set of actions.
95
+
96
+
2. **Build the Regular Lind Version**:
97
+
- Run the following command to build the standard version of Lind:
98
+
99
+
```bash
100
+
make -1
101
+
```
102
+
103
+
**Description**: This command builds the standard version of Lind, preparing it for use.
104
+
105
+
## Running RawPOSIX
106
+
### Environment Setup for RawPOSIX
107
+
To run RawPOSIX, follow these steps:
108
+
109
+
1. **Navigate to the project directory and set up the environment**:
- `git clone ...`: Clone the RawPOSIX repository from GitHub.
124
+
- `mv RawPOSIX/ safeposix-rust`: Rename the cloned directory to `safeposix-rust`.
125
+
- `cd /home/lind/lind_project`: Change to the Lind project directory.
126
+
- `make -1`: Build the project.
127
+
128
+
### Generating Network Devices for RawPOSIX
129
+
2. **Generate network devices** required for RawPOSIX:
130
+
131
+
```bash
132
+
cd src/safeposix-rust
133
+
./gen_netdev.sh
134
+
```
135
+
136
+
**Description**:
137
+
- `cd src/safeposix-rust`: Change to the `safeposix-rust` directory.
138
+
- `./gen_netdev.sh`: Run the script to generate network devices.
139
+
140
+
## Testing Suites
141
+
### Running Lind Test Suites
142
+
Navigate to the project root and run the following command:
143
+
144
+
```bash
145
+
cd /home/lind/lind_project
146
+
make test
147
+
```
148
+
149
+
**Description**: This command runs the full test suite for Lind, verifying that all components are functioning as expected.
150
+
151
+
### Running RawPOSIX Test Suites
152
+
To build and run the tests for RawPOSIX:
153
+
154
+
```bash
155
+
cd src/safeposix-rust
156
+
cargo build
157
+
cargo test
158
+
```
159
+
160
+
**Description**:
161
+
- `cargo build`: Compiles the Rust code for the RawPOSIX project.
162
+
- `cargo test`: Runs the test suite for RawPOSIX to verify functionality.
163
+
164
+
#### Running Specific Test Cases
165
+
To run a specific test case:
166
+
167
+
```bash
168
+
cargo test<TEST_CASE_NAME>
169
+
```
170
+
171
+
**Example**:
172
+
173
+
```bash
174
+
cargo test ut_lind_fs_mkdir_invalid_modebits
175
+
```
176
+
177
+
**Description**: This command runs a specific test case, allowing you to focus on one feature or functionality at a time.
178
+
179
+
## FAQ
180
+
### Handling Errors
181
+
1. **New error that requires a big fix**:
182
+
- Contact the team and inform the seniors.
183
+
- Open a GitHub issue to track the problem.
184
+
185
+
2. **Encountering a smaller issue**:
186
+
- Check if an existing issue is logged. If not, create one at: [https://github.com/Lind-Project/RawPOSIX/issues/15](https://github.com/Lind-Project/RawPOSIX/issues/15).
187
+
188
+
### Tagging for Review
189
+
- Tag two reviewers: either Alice, Nick, or Yuchen Zhang.
190
+
191
+
### Pull Request (PR) Description
192
+
- Write a clear and concise description for each PR.
193
+
- Add comments for easier understanding.
194
+
195
+
### Commenting on Code
196
+
- **Requirement**: Comments are required for new code to ensure others can understand it.
197
+
- **Future Improvements**: Reference the relevant GitHub issue for any future improvements.
198
+
199
+

200
+
201
+
## Run RawPOSIX-Rust
16
202
17
203
Quick start
18
204
Use Develop branch for the most stable behaviour.
@@ -28,21 +214,10 @@ helpful for exploration and easy testing.
28
214
29
215
See reference at [Run RustPOSIX Independently](https://github.com/Lind-Project/lind-docs/blob/main/docs/RustPOSIX/Run-Independently.md)
30
216
31
-
## Test RustPOSIX-Rust
32
-
33
-
Use main branch for the most stable behaviour.
34
-
35
-
```bash
36
-
cargo build
37
-
cargo test --lib
38
-
```
39
-
40
217
See reference at [Testing and Debugging](https://github.com/Lind-Project/lind-docs/blob/main/docs/RustPOSIX/Testing-and-Debugging.md)
41
218
42
219
## Development Guideline
43
220
44
221
* All PRs should be merged to the Develop branch
45
222
46
223
* Any imports from the standard library or any crates should be donein an interface file
47
-
48
-
More detailed guideline will be in [RustPOSIX's wiki](https://github.com/Lind-Project/lind-docs/blob/main/docs/RustPOSIX/Style-Guide.md)
0 commit comments