  We prove that generic homologically nontrivial $(2n-1)$-parameter family of
analytic discs attached by their boundaries to a CR manifold $\Omega$ in
$\mathbb C^n, n \le 2$ tests CR functions: if a smooth function on $\Omega$
extends analytically inside each analytic disc then it satisfies the tangential
CR equations.
  In particular, we answer, in real analytic category, two open questions: on
characterization of analytic functions in planar domains (the strip-problem),
and on characterization of boundary values of holomorphic functions in domains
in $\mathbb C^n$ (a conjecture of Globevnik and Stout). We also characterize
complex curves in $\mathbb C^2$ as real 2-manifolds admitiing homologically
nontrivial 1-parameter families of attached analytic discs.
  The proofs are based on reduction to a problem of propagation of degeneracy
of CR foliations of torus-like manifolds.
