| 419 | } |
| 420 | |
| 421 | func (ContainerSuite) TestExecWithWorkdir(ctx context.Context, t *testctx.T) { |
| 422 | res, err := testutil.Query[struct { |
| 423 | Container struct { |
| 424 | From struct { |
| 425 | WithWorkdir struct { |
| 426 | WithExec struct { |
| 427 | Stdout string |
| 428 | } |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | }](t, |
| 433 | `{ |
| 434 | container { |
| 435 | from(address: "`+alpineImage+`") { |
| 436 | withWorkdir(path: "/usr") { |
| 437 | withExec(args: ["pwd"]) { |
| 438 | stdout |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | }`, nil) |
| 444 | require.NoError(t, err) |
| 445 | require.Equal(t, res.Container.From.WithWorkdir.WithExec.Stdout, "/usr\n") |
| 446 | } |
| 447 | |
| 448 | func (ContainerSuite) TestExecWithoutWorkdir(ctx context.Context, t *testctx.T) { |
| 449 | c := connect(ctx, t) |