(t *testing.T)
| 1843 | } |
| 1844 | |
| 1845 | func TestShimSockLength(t *testing.T) { |
| 1846 | t.Parallel() |
| 1847 | |
| 1848 | // Max length of namespace should be 76 |
| 1849 | namespace := strings.Repeat("n", 76) |
| 1850 | |
| 1851 | ctx := namespaces.WithNamespace(t.Context(), namespace) |
| 1852 | |
| 1853 | client, err := newClient(t, address) |
| 1854 | if err != nil { |
| 1855 | t.Fatal(err) |
| 1856 | } |
| 1857 | defer client.Close() |
| 1858 | |
| 1859 | image, err := client.Pull(ctx, testImage, |
| 1860 | WithPlatformMatcher(platforms.Default()), |
| 1861 | WithPullUnpack, |
| 1862 | ) |
| 1863 | if err != nil { |
| 1864 | t.Fatal(err) |
| 1865 | } |
| 1866 | |
| 1867 | id := strings.Repeat("c", 64) |
| 1868 | |
| 1869 | // We don't have limitation with length of container name, |
| 1870 | // but 64 bytes of sha256 is the common case |
| 1871 | container, err := client.NewContainer(ctx, id, |
| 1872 | WithNewSnapshot(id, image), |
| 1873 | WithNewSpec(oci.WithImageConfig(image), withExitStatus(0)), |
| 1874 | ) |
| 1875 | if err != nil { |
| 1876 | t.Fatal(err) |
| 1877 | } |
| 1878 | defer container.Delete(ctx, WithSnapshotCleanup) |
| 1879 | |
| 1880 | task, err := container.NewTask(ctx, empty()) |
| 1881 | if err != nil { |
| 1882 | t.Fatal(err) |
| 1883 | } |
| 1884 | defer task.Delete(ctx) |
| 1885 | |
| 1886 | statusC, err := task.Wait(ctx) |
| 1887 | if err != nil { |
| 1888 | t.Fatal(err) |
| 1889 | } |
| 1890 | |
| 1891 | if err := task.Start(ctx); err != nil { |
| 1892 | t.Fatal(err) |
| 1893 | } |
| 1894 | |
| 1895 | <-statusC |
| 1896 | } |
| 1897 | |
| 1898 | func TestContainerExecLargeOutputWithTTY(t *testing.T) { |
| 1899 | if runtime.GOOS == "windows" { |
nothing calls this directly
no test coverage detected
searching dependent graphs…