Commit Graph

14 Commits

Author SHA1 Message Date
Ace-Tang
e20ba5fa51 test: add test for c/r without image
add test for both v1, v2 runtime

Signed-off-by: Ace-Tang <aceapril@126.com>
2018-12-17 12:51:14 +08:00
Evan Hazlett
6f2f4e4343 checkpoint: add copts to checkpoint; save snapshotter to annotation
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:48:16 +00:00
Evan Hazlett
40caece8dc update tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:17 +00:00
Phil Estes
85e8221f10
Tests should set up snapshot prior to any use of fs
These tests would have failed if any image had a USER declaration in it,
but because the test image never has, these were never caught. Adding
supplemental GIDs on any image revealed the issue.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2018-09-14 14:36:01 -04:00
Michael Crosby
da1b5470cd Runtime v2
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-17 10:21:29 -04:00
Derek McGowan
6b9be1bfc3
Fix creation of DirectIO overwriting fifo config
Creating a direct IO should not overwrite the fifo
configuration. The fifo configuration can be updated
before creating the direct io if needed.
This fixes an expected change in behavior for clients
who were calling NewDirectIO previously with terminal
configured on the fifo.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-06-01 16:04:22 -07:00
Andrei Vagin
566389ade4 test: Check C/R for containers with TTYs
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-04-28 01:06:42 +03:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Daniel Nephin
1cd32fa68d Cleanup extra returns in tests
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2018-01-23 14:09:22 -05:00
Daniel Nephin
cdf62f69a1 Fix usage of oci in other packages.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-27 16:16:17 -05:00
Michael Crosby
c601606f84 Move spec generation to Container Create
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-24 10:32:16 -04:00
Michael Crosby
fa14f2ef3a Add context and client to SpecOpts
In order to do more advanced spec generation with images, snapshots,
etc, we need to inject the context and client into the spec generation
code.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-24 10:32:16 -04:00
Brian Goff
026896ac4c Make Wait() async
In all of the examples, its recommended to call `Wait()` before starting
a process/task.
Since `Wait()` is a blocking call, this means it must be called from a
goroutine like so:

```go
statusC := make(chan uint32)
go func() {
  status, err := task.Wait(ctx)
  if err != nil {
    // handle async err
  }

  statusC <- status
}()

task.Start(ctx)
<-statusC
```

This means there is a race here where there is no guarentee when the
goroutine is going to be scheduled, and even a bit more since this
requires an RPC call to be made.
In addition, this code is very messy and a common pattern for any caller
using Wait+Start.

Instead, this changes `Wait()` to use an async model having `Wait()`
return a channel instead of the code itself.
This ensures that when `Wait()` returns that the client has a handle on
the event stream (already made the RPC request) before returning and
reduces any sort of race to how the stream is handled by grpc since we
can't guarentee that we have a goroutine running and blocked on
`Recv()`.

Making `Wait()` async also cleans up the code in the caller drastically:

```go
statusC, err := task.Wait(ctx)
if err != nil {
  return err
}

task.Start(ctx)

status := <-statusC
if status.Err != nil {
  return err
}
```

No more spinning up goroutines and more natural error
handling for the caller.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-22 09:33:07 -04:00
Kenfe-Mickael Laventure
eb0970bbd1
Mark relevant tests as elligible for parallelism
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-08-14 14:43:43 -07:00